
'''simple docstring'''

from __future__ import annotations







def 	A  (   UpperCamelCase_       :  str    ,						UpperCamelCase_       :  list[str] | None = None   )       ->							list[list[str]]:







			'''simple docstring'''



			lowerCAmelCase__										=				word_bank or []
			# create a table
			lowerCAmelCase__										=				len(UpperCamelCase_   ) + 1

			lowerCAmelCase__										=				[]
			for _ in range(UpperCamelCase_   ):
						table.append([]   )
			# seed value
			lowerCAmelCase__										=				[[]]  # because empty string has empty combination

			# iterate through the indices
			for i in range(UpperCamelCase_   ):
						# condition
						if table[i] != []:
									for word in word_bank:
												# slice condition
												if target[i : i + len(UpperCamelCase_   )] == word:
															lowerCAmelCase__										=				[
															    [word, *way] for way in table[i]
															]
															# adds the word to every combination the current position holds
															# now,push that combination to the table[i+len(word)]
															table[i + len(UpperCamelCase_   )] += new_combinations

    # combinations are in reverse order so reverse for better output
			for combination in table[len(UpperCamelCase_   )]:
						combination.reverse()

			return table[len(UpperCamelCase_   )]


if __name__ == "__main__":
		print(all_construct("jwajalapa", ["jwa", "j", "w", "a", "la", "lapa"]))
		print(all_construct("rajamati", ["s", "raj", "amat", "raja", "ma", "i", "t"]))
		print(
		    all_construct(
		        "hexagonosaurus",
		        ["h", "ex", "hex", "ag", "ago", "ru", "auru", "rus", "go", "no", "o", "s"],
		    )
		)










from collections.abc import Sequence






def  lowerCamelCase_	(      lowerCAmelCase__	:	Sequence[int] | None = None				)       ->							int:

							'''simple docstring'''






							if nums is None or not nums:
														raise ValueError('Input sequence should not be empty'				)

							A      						=    nums[0]
							for i in range(1			,	len(lowerCAmelCase__				)				):
														A      						=    nums[i]
														A      						=    max(lowerCAmelCase__			,	ans + num			,	lowerCAmelCase__				)

							return ans


if __name__ == "__main__":
				import doctest

				doctest.testmod()

				# Try on a sample input from the user
				__snake_case     :str			       =int(input('Enter number of elements : ').strip())
				__snake_case     :Optional[int]			       =list(map(int, input('\nEnter the numbers : ').strip().split()))[:n]
				print(max_subsequence_sum(array))