



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



class   UpperCAmelCase_    :







							def __init__(   self,			__a):

														'''simple docstring'''

														_lowerCAmelCase     :							Any    =    data
														_lowerCAmelCase     :							Tuple    =    [0X67_45_23_01, 0XEF_CD_AB_89, 0X98_BA_DC_FE, 0X10_32_54_76, 0XC3_D2_E1_F0]







							@staticmethod
							def    snake_case__      (   __a,			__a):

														'''simple docstring'''

														return ((n << b) | (n >> (32 - b))) & 0XFF_FF_FF_FF







							def    snake_case__      (   self):

														'''simple docstring'''

														_lowerCAmelCase     :							Optional[Any]    =    B"\x80" + B"\x00" * (63 - (len(self.data) + 8) % 64)
														_lowerCAmelCase     :							int    =    self.data + padding + struct.pack(">Q",			8 * len(self.data))
														return padded_data







							def    snake_case__      (   self):

														'''simple docstring'''

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







							def    snake_case__      (   self,			__a):

														'''simple docstring'''

														_lowerCAmelCase     :							Optional[Any]    =    list(struct.unpack(">16L",			__a)) + [0] * 64
														for i in range(16,			80):
																					_lowerCAmelCase     :							Dict    =    self.rotate((w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]),			1)
														return w







							def    snake_case__      (   self):

														'''simple docstring'''

														_lowerCAmelCase     :							Optional[int]    =    self.padding()
														_lowerCAmelCase     :							int    =    self.split_blocks()
														for block in self.blocks:
																					_lowerCAmelCase     :							str    =    self.expand_block(__a)
																					_lowerCAmelCase   ,    _lowerCAmelCase   ,    _lowerCAmelCase   ,    _lowerCAmelCase   ,    _lowerCAmelCase     :							Union[str, Any]    =    self.h
																					for i in range(0,			80):
																												if 0 <= i < 20:
																																			_lowerCAmelCase     :							int    =    (b & c) | ((~b) & d)
																																			_lowerCAmelCase     :							str    =    0X5A_82_79_99
																												elif 20 <= i < 40:
																																			_lowerCAmelCase     :							Optional[Any]    =    b ^ c ^ d
																																			_lowerCAmelCase     :							Optional[Any]    =    0X6E_D9_EB_A1
																												elif 40 <= i < 60:
																																			_lowerCAmelCase     :							List[str]    =    (b & c) | (b & d) | (c & d)
																																			_lowerCAmelCase     :							Union[str, Any]    =    0X8F_1B_BC_DC
																												elif 60 <= i < 80:
																																			_lowerCAmelCase     :							Optional[int]    =    b ^ c ^ d
																																			_lowerCAmelCase     :							str    =    0XCA_62_C1_D6
																												_lowerCAmelCase   ,    _lowerCAmelCase   ,    _lowerCAmelCase   ,    _lowerCAmelCase   ,    _lowerCAmelCase     :							Dict    =    (
																												    self.rotate(__a,			5) + f + e + k + expanded_block[i] & 0XFF_FF_FF_FF,
																												    a,
																												    self.rotate(__a,			30),
																												    c,
																												    d,
																												)
																					_lowerCAmelCase     :							str    =    (
																					    self.h[0] + a & 0XFF_FF_FF_FF,
																					    self.h[1] + b & 0XFF_FF_FF_FF,
																					    self.h[2] + c & 0XFF_FF_FF_FF,
																					    self.h[3] + d & 0XFF_FF_FF_FF,
																					    self.h[4] + e & 0XFF_FF_FF_FF,
																					)
														return ("{:08x}" * 5).format(*self.h)






def 				A				(					):





							'''simple docstring'''




							_lowerCAmelCase     :							Any    =    b"Test String"
							assert SHAaHash(_lowerCamelCase  ).final_hash() == hashlib.shaa(_lowerCamelCase  ).hexdigest()  # noqa: S324






def 				A				(					):





							'''simple docstring'''




							_lowerCAmelCase     :							List[str]    =    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     :							Union[str, Any]    =    parser.parse_args()
							_lowerCAmelCase     :							Tuple    =    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     :							Any    =    bytes(_lowerCamelCase				, "utf-8"  )
							print(SHAaHash(_lowerCamelCase  ).final_hash()  )


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

						doctest.testmod()





from __future__ import annotations

import bisect






def 				A				(					_lowerCamelCase				, _lowerCamelCase				, _lowerCamelCase = 0				, _lowerCamelCase = -1  ):





							'''simple docstring'''




							if hi < 0:
														_lowerCAmelCase     :							int    =    len(_lowerCamelCase  )

							while lo < hi:
														_lowerCAmelCase     :							Optional[Any]    =    lo + (hi - lo) // 2
														if sorted_collection[mid] < item:
																					_lowerCAmelCase     :							Union[str, Any]    =    mid + 1
														else:
																					_lowerCAmelCase     :							str    =    mid

							return lo






def 				A				(					_lowerCamelCase				, _lowerCamelCase				, _lowerCamelCase = 0				, _lowerCamelCase = -1  ):





							'''simple docstring'''




							if hi < 0:
														_lowerCAmelCase     :							str    =    len(_lowerCamelCase  )

							while lo < hi:
														_lowerCAmelCase     :							Tuple    =    lo + (hi - lo) // 2
														if sorted_collection[mid] <= item:
																					_lowerCAmelCase     :							Dict    =    mid + 1
														else:
																					_lowerCAmelCase     :							str    =    mid

							return lo






def 				A				(					_lowerCamelCase				, _lowerCamelCase				, _lowerCamelCase = 0				, _lowerCamelCase = -1  ):





							'''simple docstring'''




							sorted_collection.insert(bisect_left(_lowerCamelCase				, _lowerCamelCase				, _lowerCamelCase				, _lowerCamelCase  )				, _lowerCamelCase  )






def 				A				(					_lowerCamelCase				, _lowerCamelCase				, _lowerCamelCase = 0				, _lowerCamelCase = -1  ):





							'''simple docstring'''




							sorted_collection.insert(bisect_right(_lowerCamelCase				, _lowerCamelCase				, _lowerCamelCase				, _lowerCamelCase  )				, _lowerCamelCase  )






def 				A				(					_lowerCamelCase				, _lowerCamelCase  ):





							'''simple docstring'''




							_lowerCAmelCase     :							int    =    0
							_lowerCAmelCase     :							Union[str, Any]    =    len(_lowerCamelCase  ) - 1

							while left <= right:
														_lowerCAmelCase     :							int    =    left + (right - left) // 2
														_lowerCAmelCase     :							int    =    sorted_collection[midpoint]
														if current_item == item:
																					return midpoint
														elif item < current_item:
																					_lowerCAmelCase     :							str    =    midpoint - 1
														else:
																					_lowerCAmelCase     :							Any    =    midpoint + 1
							return None






def 				A				(					_lowerCamelCase				, _lowerCamelCase  ):





							'''simple docstring'''




							_lowerCAmelCase     :							Tuple    =    bisect.bisect_left(_lowerCamelCase				, _lowerCamelCase  )
							if index != len(_lowerCamelCase  ) and sorted_collection[index] == item:
														return index
							return None






def 				A				(					_lowerCamelCase				, _lowerCamelCase				, _lowerCamelCase				, _lowerCamelCase  ):





							'''simple docstring'''




							if right < left:
														return None

							_lowerCAmelCase     :							Optional[int]    =    left + (right - left) // 2

							if sorted_collection[midpoint] == item:
														return midpoint
							elif sorted_collection[midpoint] > item:
														return binary_search_by_recursion(_lowerCamelCase				, _lowerCamelCase				, _lowerCamelCase				, midpoint - 1  )
							else:
														return binary_search_by_recursion(_lowerCamelCase				, _lowerCamelCase				, midpoint + 1				, _lowerCamelCase  )


if __name__ == "__main__":
						_snake_case		=  input("Enter numbers separated by comma:\n").strip()
						_snake_case		=  sorted(int(item) for item in user_input.split(","))
						_snake_case		=  int(input("Enter a single number to be found in the list:\n"))
						_snake_case		=  binary_search(collection, target)
						if result is None:
												print(f'''{target} was not found in {collection}.''')
						else:
												print(f'''{target} was found at position {result} in {collection}.''')
