

def 					lowerCamelCase_     (							UpperCAmelCase_							:     str							,       UpperCAmelCase_							:     str	)						->				Tuple:




	'''simple docstring'''




	assert x is not None
	assert y is not None

	_UpperCamelCase   :		List[str]			=						len(UpperCAmelCase_	)
	_UpperCamelCase   :		Tuple			=						len(UpperCAmelCase_	)

	# declaring the array for storing the dp values
	_UpperCamelCase   :		Tuple			=						[[0] * (n + 1) for _ in range(m + 1	)]  # noqa: E741

	for i in range(1							,       m + 1	):
		for j in range(1							,       n + 1	):
			_UpperCamelCase   :		List[Any]			=						1 if x[i - 1] == y[j - 1] else 0

			_UpperCamelCase   :		Any			=						max(l[i - 1][j]							,       l[i][j - 1]							,       l[i - 1][j - 1] + match	)

	_UpperCamelCase   :		int			=						''
	_UpperCamelCase	,		_UpperCamelCase   :		Optional[int]			=						m, n
	while i > 0 and j > 0:
		_UpperCamelCase   :		Any			=						1 if x[i - 1] == y[j - 1] else 0

		if l[i][j] == l[i - 1][j - 1] + match:
			if match == 1:
				_UpperCamelCase   :		Optional[Any]			=						x[i - 1] + seq
			i -= 1
			j -= 1
		elif l[i][j] == l[i - 1][j]:
			i -= 1
		else:
			j -= 1

	return l[m][n], seq


if __name__ == "__main__":
							lowerCAmelCase__								=		"""AGGTAB"""
							lowerCAmelCase__								=		"""GXTXAYB"""
							lowerCAmelCase__								=		4
							lowerCAmelCase__								=		"""GTAB"""

							lowerCAmelCase__			, lowerCAmelCase__								=		longest_common_subsequence(a, b)
							print("""len =""", ln, """, sub-sequence =""", subseq)
							import doctest

							doctest.testmod()







def 					lowerCamelCase_     (							UpperCAmelCase_							:     list	)						->				list:




	'''simple docstring'''




	if len(UpperCAmelCase_	) <= 1:
		return [tuple(UpperCAmelCase_	)]

	_UpperCamelCase   :		List[Any]			=						[]

	def generate(UpperCAmelCase_							:     int							,       UpperCAmelCase_							:     list	):
		_UpperCamelCase   :		Optional[int]			=						[0] * n
		res.append(tuple(UpperCAmelCase_	)	)

		_UpperCamelCase   :		List[Any]			=						0
		while i < n:
			if c[i] < i:
				if i % 2 == 0:
					_UpperCamelCase	,		_UpperCamelCase   :		List[str]			=						arr[i], arr[0]
				else:
					_UpperCamelCase	,		_UpperCamelCase   :		List[str]			=						arr[i], arr[c[i]]
				res.append(tuple(UpperCAmelCase_	)	)
				c[i] += 1
				_UpperCamelCase   :		Tuple			=						0
			else:
				_UpperCamelCase   :		Tuple			=						0
				i += 1

	generate(len(UpperCAmelCase_	)							,       UpperCAmelCase_	)
	return res


if __name__ == "__main__":
							lowerCAmelCase__								=		input("""Enter numbers separated by a comma:\n""").strip()
							lowerCAmelCase__								=		[int(item) for item in user_input.split(""",""")]
							print(heaps(arr))




