






"""simple docstring"""
import random
import sys

A_			: Any				=			"ABCDEFGHIJKLMNOPQRSTUVWXYZ"






def        lowerCamelCase_  (						):
 lowerCamelCase__     :			int     				=						input('Enter message: '				)
 lowerCamelCase__     :			Union[str, Any]     				=						'LFWOAYUISVKMNXPBDCRJTQEGHZ'
 lowerCamelCase__     :			List[str]     				=						input('Encrypt/Decrypt [e/d]: '				)

 check_valid_key(_lowerCamelCase				)

 if resp.lower().startswith('e'				):
  lowerCamelCase__     :			Optional[Any]     				=						'encrypt'
  lowerCamelCase__     :			int     				=						encrypt_message(_lowerCamelCase			,   _lowerCamelCase				)
 elif resp.lower().startswith('d'				):
  lowerCamelCase__     :			int     				=						'decrypt'
  lowerCamelCase__     :			Union[str, Any]     				=						decrypt_message(_lowerCamelCase			,   _lowerCamelCase				)

 print(f'''\n{mode.title()}ion: \n{translated}'''				)






def        lowerCamelCase_  (						_lowerCamelCase				):
 lowerCamelCase__     :			Any     				=						list(_lowerCamelCase				)
 lowerCamelCase__     :			Tuple     				=						list(_lowerCamelCase				)
 key_list.sort()
 letters_list.sort()

 if key_list != letters_list:
  sys.exit('Error in the key or symbol set.'				)






def        lowerCamelCase_  (						_lowerCamelCase			,   _lowerCamelCase				):
 return translate_message(_lowerCamelCase			,   _lowerCamelCase			,   'encrypt'				)






def        lowerCamelCase_  (						_lowerCamelCase			,   _lowerCamelCase				):
 return translate_message(_lowerCamelCase			,   _lowerCamelCase			,   'decrypt'				)






def        lowerCamelCase_  (						_lowerCamelCase			,   _lowerCamelCase			,   _lowerCamelCase				):
 lowerCamelCase__     :			str     				=						''
 lowerCamelCase__     :			Union[str, Any]     				=						LETTERS
 lowerCamelCase__     :			Optional[int]     				=						key

 if mode == "decrypt":
  lowerCamelCase__				,     lowerCamelCase__     :			int     				=						chars_b, chars_a

 for symbol in message:
  if symbol.upper() in chars_a:
   lowerCamelCase__     :			List[Any]     				=						chars_a.find(symbol.upper()				)
   if symbol.isupper():
    translated += chars_b[sym_index].upper()
   else:
    translated += chars_b[sym_index].lower()
  else:
   translated += symbol

 return translated






def        lowerCamelCase_  (						):
 lowerCamelCase__     :			Tuple     				=						list(_lowerCamelCase				)
 random.shuffle(_lowerCamelCase				)
 return "".join(_lowerCamelCase				)


if __name__ == "__main__":
      main()









"""simple docstring"""
import os






def        lowerCamelCase_  (						):
 lowerCamelCase__     :			List[Any]     				=						os.path.dirname(os.path.realpath(_lowerCamelCase				)				)
 lowerCamelCase__     :			Any     				=						os.path.join(_lowerCamelCase			,   'triangle.txt'				)

 with open(_lowerCamelCase				) as in_file:
  lowerCamelCase__     :			Dict     				=						[[int(_lowerCamelCase				) for i in line.split()] for line in in_file]

 while len(_lowerCamelCase				) != 1:
  lowerCamelCase__     :			Dict     				=						triangle.pop()
  lowerCamelCase__     :			Optional[Any]     				=						triangle[-1]
  for j in range(len(_lowerCamelCase				) - 1				):
   curr_row[j] += max(last_row[j]			,   last_row[j + 1]				)
 return triangle[0][0]


if __name__ == "__main__":
      print(solution())

