
import math
def 							SCREAMING_SNAKE_CASE_	(					)			->						None:
       SCREAMING_SNAKE_CASE_							:				Optional[Any]		=input('''Enter message: '''				)
       SCREAMING_SNAKE_CASE_							:				Tuple		=int(input(f'Enter key [2-{len(UpperCAmelCase_				) - 1}]: '				)				)
       SCREAMING_SNAKE_CASE_							:				List[Any]		=input('''Encryption/Decryption [e/d]: '''				)

       if mode.lower().startswith('''e'''				):
              SCREAMING_SNAKE_CASE_							:				Any		=encrypt_message(UpperCAmelCase_			,							UpperCAmelCase_				)
       elif mode.lower().startswith('''d'''				):
              SCREAMING_SNAKE_CASE_							:				int		=decrypt_message(UpperCAmelCase_			,							UpperCAmelCase_				)

       # Append pipe symbol (vertical bar) to identify spaces at the end.
       print(f'Output:\n{text + "|"}'				)
def 							SCREAMING_SNAKE_CASE_	(					UpperCAmelCase_	:     int			,							UpperCAmelCase_	:     str				)			->						str:
       SCREAMING_SNAKE_CASE_							:				List[str]		=[''''''] * key
       for col in range(UpperCAmelCase_				):
              SCREAMING_SNAKE_CASE_							:				str		=col
              while pointer < len(UpperCAmelCase_				):
                     cipher_text[col] += message[pointer]
                     pointer += key
       return "".join(UpperCAmelCase_				)
def 							SCREAMING_SNAKE_CASE_	(					UpperCAmelCase_	:     int			,							UpperCAmelCase_	:     str				)			->						str:
       SCREAMING_SNAKE_CASE_							:				Optional[int]		=math.ceil(len(UpperCAmelCase_				) / key				)
       SCREAMING_SNAKE_CASE_							:				Optional[Any]		=key
       SCREAMING_SNAKE_CASE_							:				int		=(num_cols * num_rows) - len(UpperCAmelCase_				)
       SCREAMING_SNAKE_CASE_							:				Any		=[''''''] * num_cols
       SCREAMING_SNAKE_CASE_							:				Dict		=0
       SCREAMING_SNAKE_CASE_							:				Dict		=0

       for symbol in message:
              plain_text[col] += symbol
              col += 1

              if (
                  (col == num_cols)
                  or (col == num_cols - 1)
                  and (row >= num_rows - num_shaded_boxes)
              ):
                     SCREAMING_SNAKE_CASE_							:				str		=0
                     row += 1

       return "".join(UpperCAmelCase_				)


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 main()


from collections.abc import Sequence
def 							SCREAMING_SNAKE_CASE_	(					UpperCAmelCase_	:     Sequence[int] | None = None				)			->						int:
       if nums is None or not nums:
              raise ValueError('''Input sequence should not be empty'''				)

       SCREAMING_SNAKE_CASE_							:				Tuple		=nums[0]
       for i in range(1			,							len(UpperCAmelCase_				)				):
              SCREAMING_SNAKE_CASE_							:				Any		=nums[i]
              SCREAMING_SNAKE_CASE_							:				Optional[int]		=max(UpperCAmelCase_			,							ans + num			,							UpperCAmelCase_				)

       return ans


if __name__ == "__main__":
 import doctest

 doctest.testmod()

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