"""simple docstring"""





import argparse
import hashlib  # hashlib is only used inside the Test class
import struct
class        _snake_case   :






						def __init__(				self					:	str							,    UpperCAmelCase					:	List[str]			):
													__lowerCamelCase    :						Union[str, Any]						      =   data
													__lowerCamelCase    :						List[Any]						      =   [0X67_452_301, 0XEF_CDA_B89, 0X98_BAD_CFE, 0X10_325_476, 0XC3_D2E_1F0]






						@staticmethod
						def 					lowerCamelCase__   (				UpperCAmelCase					:	Any							,    UpperCAmelCase					:	Any			):
													return ((n << b) | (n >> (32 - b))) & 0XFF_FFF_FFF






						def 					lowerCamelCase__   (				self					:	List[Any]			):
													__lowerCamelCase    :						Dict						      =   B'\x80' + B'\x00' * (63 - (len(self.data			) + 8) % 64)
													__lowerCamelCase    :						Any						      =   self.data + padding + struct.pack(">Q"							,    8 * len(self.data			)			)
													return padded_data






						def 					lowerCamelCase__   (				self					:	str			):
													return [
													    self.padded_data[i : i + 64] for i in range(0							,    len(self.padded_data			)							,    64			)
													]






						def 					lowerCamelCase__   (				self					:	Union[str, Any]							,    UpperCAmelCase					:	int			):
													__lowerCamelCase    :						int						      =   list(struct.unpack(">16L"							,    __UpperCAmelCase			)			) + [0] * 64
													for i in range(16							,    80			):
																				__lowerCamelCase    :						Any						      =   self.rotate((w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16])							,    1			)
													return w







						def 					lowerCamelCase__   (				self					:	List[Any]			):
													__lowerCamelCase    :						str						      =   self.padding()
													__lowerCamelCase    :						List[str]						      =   self.split_blocks()
													for block in self.blocks:
																				__lowerCamelCase    :						int						      =   self.expand_block(__UpperCAmelCase			)
																				__lowerCamelCase    :						Any						      =   self.h
																				for i in range(0							,    80			):
																											if 0 <= i < 20:
																																		__lowerCamelCase    :						Tuple						      =   (b & c) | ((~b) & d)
																																		__lowerCamelCase    :						Any						      =   0X5A_827_999
																											elif 20 <= i < 40:
																																		__lowerCamelCase    :						str						      =   b ^ c ^ d
																																		__lowerCamelCase    :						Dict						      =   0X6E_D9E_BA1
																											elif 40 <= i < 60:
																																		__lowerCamelCase    :						Optional[int]						      =   (b & c) | (b & d) | (c & d)
																																		__lowerCamelCase    :						str						      =   0X8F_1BB_CDC
																											elif 60 <= i < 80:
																																		__lowerCamelCase    :						Optional[Any]						      =   b ^ c ^ d
																																		__lowerCamelCase    :						Any						      =   0XCA_62C_1D6
																											__lowerCamelCase    :						Union[str, Any]						      =   (
																											    self.rotate(__UpperCAmelCase							,    5			) + f + e + k + expanded_block[i] & 0XFF_FFF_FFF,
																											    a,
																											    self.rotate(__UpperCAmelCase							,    30			),
																											    c,
																											    d,
																											)
																				__lowerCamelCase    :						Dict						      =   (
																				    self.h[0] + a & 0XFF_FFF_FFF,
																				    self.h[1] + b & 0XFF_FFF_FFF,
																				    self.h[2] + c & 0XFF_FFF_FFF,
																				    self.h[3] + d & 0XFF_FFF_FFF,
																				    self.h[4] + e & 0XFF_FFF_FFF,
																				)
													return ("{:08x}" * 5).format(*self.h			)


def       lowercase_      (      )       ->					Optional[Any]:



							'''simple docstring'''

							__lowerCamelCase    :						Dict						      =   B'Test String'
							assert SHAaHash(_SCREAMING_SNAKE_CASE					).final_hash() == hashlib.shaa(_SCREAMING_SNAKE_CASE					).hexdigest()  # noqa: S324


def       lowercase_      (      )       ->					Dict:



							'''simple docstring'''

							__lowerCamelCase    :						Union[str, Any]						      =   argparse.ArgumentParser(description="Process some strings or files"					)
							parser.add_argument(
							    "--string"  ,      dest="input_string"  ,      default="Hello World!! Welcome to Cryptography"  ,      help="Hash the string"  ,      )
							parser.add_argument("--file"  ,      dest="input_file"  ,      help="Hash contents of a file"					)
							__lowerCamelCase    :						Dict						      =   parser.parse_args()
							__lowerCamelCase    :						Optional[int]						      =   args.input_string
							# In any case hash input should be a bytestring
							if args.input_file:
														with open(args.input_file  ,      "rb"					) as f:
																					__lowerCamelCase    :						List[Any]						      =   f.read()
							else:
														__lowerCamelCase    :						int						      =   bytes(_SCREAMING_SNAKE_CASE  ,      "utf-8"					)
							print(SHAaHash(_SCREAMING_SNAKE_CASE					).final_hash()					)


if __name__ == "__main__":
				main()
				import doctest

				doctest.testmod()






"""simple docstring"""





import math
def  __A   (_SCREAMING_SNAKE_CASE			)					->int:





  """simple docstring"""


  if not isinstance(_SCREAMING_SNAKE_CASE     ,   _SCREAMING_SNAKE_CASE			):
    lowerCAmelCase__			:Dict											=							F"Input value of [number={number}] must be an integer"
    raise TypeError(_SCREAMING_SNAKE_CASE			)

  if number < 1:
    lowerCAmelCase__			:Dict											=							F"Input value of [number={number}] must be > 0"
    raise ValueError(_SCREAMING_SNAKE_CASE			)
  elif number == 1:
    return 3
  elif number == 2:
    return 5
  else:
    lowerCAmelCase__			:Union[str, Any]											=							int(math.log(number // 3     ,   2			)			) + 2

    lowerCAmelCase__			:Optional[Any]											=							[3, 5]
    lowerCAmelCase__			:Optional[Any]											=							2
    lowerCAmelCase__			:List[str]											=							3
    for block in range(1     ,   _SCREAMING_SNAKE_CASE			):
      for _ in range(_SCREAMING_SNAKE_CASE			):
        proth_list.append(2 ** (block + 1) + proth_list[proth_index - 1]			)
        proth_index += 1
      increment *= 2

  return proth_list[number - 1]


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  for number in range(11):
    __A											=		0
    try:
      __A											=		proth(number)
    except ValueError:
      print(F'''ValueError: there is no {number}th Proth number''')
      continue

    print(F'''The {number}th Proth number: {value}''')
