




'''simple docstring'''


_snake_case				:				List[Any]       							=		'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
def 		snake_case_   ():





       '''simple docstring'''


       _a     					=    input('''Enter message: '''				)
       _a     					=    input('''Enter key [alphanumeric]: '''				)
       _a     					=    input('''Encrypt/Decrypt [e/d]: '''				)

       if mode.lower().startswith('''e'''				):
              _a     					=    '''encrypt'''
              _a     					=    encrypt_message(UpperCamelCase			,						UpperCamelCase				)
       elif mode.lower().startswith('''d'''				):
              _a     					=    '''decrypt'''
              _a     					=    decrypt_message(UpperCamelCase			,						UpperCamelCase				)

       print(f'\n{mode.title()}ed message:'				)
       print(UpperCamelCase				)
def 		snake_case_   (UpperCamelCase	:  str			,						UpperCamelCase	:  str				):





       '''simple docstring'''


       return translate_message(UpperCamelCase			,						UpperCamelCase			,						'''encrypt'''				)
def 		snake_case_   (UpperCamelCase	:  str			,						UpperCamelCase	:  str				):





       '''simple docstring'''


       return translate_message(UpperCamelCase			,						UpperCamelCase			,						'''decrypt'''				)
def 		snake_case_   (UpperCamelCase	:  str			,						UpperCamelCase	:  str			,						UpperCamelCase	:  str				):





       '''simple docstring'''


       _a     					=    []
       _a     					=    0
       _a     					=    key.upper()

       for symbol in message:
              _a     					=    LETTERS.find(symbol.upper()				)
              if num != -1:
                     if mode == "encrypt":
                            num += LETTERS.find(key[key_index]				)
                     elif mode == "decrypt":
                            num -= LETTERS.find(key[key_index]				)

                     num %= len(UpperCamelCase				)

                     if symbol.isupper():
                            translated.append(LETTERS[num]				)
                     elif symbol.islower():
                            translated.append(LETTERS[num].lower()				)

                     key_index += 1
                     if key_index == len(UpperCamelCase				):
                            _a     					=    0
              else:
                     translated.append(UpperCamelCase				)
       return "".join(UpperCamelCase				)


if __name__ == "__main__":
    main()







'''simple docstring'''


def 		snake_case_   (UpperCamelCase	:  str			,						UpperCamelCase	:  Any				):





							'''simple docstring'''


							return (pointa[0] - pointa[0]) ** 2 + (pointa[1] - pointa[1]) ** 2
def 		snake_case_   (UpperCamelCase	:  Any			,						UpperCamelCase	:  str=0				):





							'''simple docstring'''


							return sorted(UpperCamelCase			,						key=lambda UpperCamelCase				: x[column]				)
def 		snake_case_   (UpperCamelCase	:  Optional[int]			,						UpperCamelCase	:  Any			,						UpperCamelCase	:  Union[str, Any]=float('''inf'''				)				):





							'''simple docstring'''


							for i in range(points_counts - 1				):
														for j in range(i + 1			,						UpperCamelCase				):
																					_a     					=    euclidean_distance_sqr(points[i]			,						points[j]				)
																					if current_dis < min_dis:
																												_a     					=    current_dis
							return min_dis
def 		snake_case_   (UpperCamelCase	:  int			,						UpperCamelCase	:  Tuple			,						UpperCamelCase	:  List[str]=float('''inf'''				)				):





							'''simple docstring'''


							for i in range(min(6			,						points_counts - 1				)			,						UpperCamelCase				):
														for j in range(max(0			,						i - 6				)			,						UpperCamelCase				):
																					_a     					=    euclidean_distance_sqr(points[i]			,						points[j]				)
																					if current_dis < min_dis:
																												_a     					=    current_dis
							return min_dis
def 		snake_case_   (UpperCamelCase	:  int			,						UpperCamelCase	:  List[Any]			,						UpperCamelCase	:  int				):





							'''simple docstring'''


							if points_counts <= 3:
														return dis_between_closest_pair(UpperCamelCase			,						UpperCamelCase				)

							# recursion
							_a     					=    points_counts // 2
							_a     					=    closest_pair_of_points_sqr(
							    UpperCamelCase			,						points_sorted_on_y[:mid]			,						UpperCamelCase				)
							_a     					=    closest_pair_of_points_sqr(
							    UpperCamelCase			,						points_sorted_on_y[mid:]			,						points_counts - mid				)
							_a     					=    min(UpperCamelCase			,						UpperCamelCase				)
							_a     					=    []
							for point in points_sorted_on_x:
														if abs(point[0] - points_sorted_on_x[mid][0]				) < closest_pair_dis:
																					cross_strip.append(UpperCamelCase				)

							_a     					=    dis_between_closest_in_strip(
							    UpperCamelCase			,						len(UpperCamelCase				)			,						UpperCamelCase				)
							return min(UpperCamelCase			,						UpperCamelCase				)
def 		snake_case_   (UpperCamelCase	:  Optional[int]			,						UpperCamelCase	:  List[str]				):





							'''simple docstring'''


							_a     					=    column_based_sort(UpperCamelCase			,						column=0				)
							_a     					=    column_based_sort(UpperCamelCase			,						column=1				)
							return (
							    closest_pair_of_points_sqr(
							        UpperCamelCase			,						UpperCamelCase			,						UpperCamelCase				)
							) ** 0.5


if __name__ == "__main__":
				_snake_case				:				int       							=		[(2, 3), (12, 30), (40, 50), (5, 1), (12, 10), (3, 4)]
				print('Distance:', closest_pair_of_points(points, len(points)))

