




"""simple docstring"""

import os
import sys
import time

from . import transposition_cipher as trans_cipher

def 						lowercase_ (						):




	"""simple docstring"""






	A_					:			Tuple						=						'''Prehistoric Men.txt'''
	A_					:			Union[str, Any]						=						'''Output.txt'''
	A_					:			Tuple						=						int(input('''Enter key: '''		)		)
	A_					:			Tuple						=						input('''Encrypt/Decrypt [e/d]: '''		)

	if not os.path.exists(_UpperCAmelCase		):
		print(f"""File {input_file} does not exist. Quitting..."""		)
		sys.exit()
	if os.path.exists(_UpperCAmelCase		):
		print(f"""Overwrite {output_file}? [y/n]"""		)
		A_					:			Union[str, Any]						=						input('''> '''		)
		if not response.lower().startswith('''y'''		):
			sys.exit()

	A_					:			Union[str, Any]						=						time.time()
	if mode.lower().startswith('''e'''		):
		with open(_UpperCAmelCase		) as f:
			A_					:			Optional[Any]						=						f.read()
		A_					:			str						=						trans_cipher.encrypt_message(_UpperCAmelCase					, _UpperCAmelCase		)
	elif mode.lower().startswith('''d'''		):
		with open(_UpperCAmelCase		) as f:
			A_					:			Tuple						=						f.read()
		A_					:			Any						=						trans_cipher.decrypt_message(_UpperCAmelCase					, _UpperCAmelCase		)

	with open(_UpperCAmelCase					, '''w'''		) as output_obj:
		output_obj.write(_UpperCAmelCase		)

	A_					:			Union[str, Any]						=						round(time.time() - start_time					, 2		)
	print(('''Done (''', total_time, '''seconds )''')		)


if __name__ == "__main__":
		main()











"""simple docstring"""

def 						lowercase_ (						_UpperCAmelCase		):




	"""simple docstring"""






	A_					:			Optional[int]						=						9

	while num > 0:
		if num % 10 != digit:
			return False
		num //= 100
		digit -= 1

	return True

def 						lowercase_ (						):




	"""simple docstring"""






	A_					:			Dict						=						1_3890_2663

	while not is_square_form(num * num		):
		if num % 10 == 3:
			num -= 6  # (3 - 6) % 10 = 7
		else:
			num -= 4  # (7 - 4) % 10 = 3

	return num * 10


if __name__ == "__main__":
		print(f'{solution() = }')





