


from __future__ import annotations



def     __lowerCAmelCase						(							snake_case	:    int						,      snake_case	:    int )       ->							list[list[int]]:
   __lowerCamelCase:				list[list[int]]     =	[]
   create_all_state(1						,      a_						,      a_						,      []						,      a_ )
   return result



def     __lowerCAmelCase						(							snake_case	:    int						,      snake_case	:    int						,      snake_case	:    int						,      snake_case	:    list[int]						,      snake_case	:    list[list[int]]						,      )       ->							None:






   if level == 0:
      total_list.append(current_list[:] )
      return

   for i in range(a_						,      total_number - level + 2 ):
      current_list.append(a_ )
      create_all_state(i + 1						,      a_						,      level - 1						,      a_						,      a_ )
      current_list.pop()



def     __lowerCAmelCase						(							snake_case	:    list[list[int]] )       ->							None:






   for i in total_list:
      print(*a_ )


if __name__ == "__main__":
  _A		:				Optional[int]									=       4
  _A		:				Tuple									=       2
  _A		:				Tuple									=       generate_all_combinations(n, k)
  print_all_state(total_list)






_A		:				Tuple									=       '''ABCDEFGHIJKLMNOPQRSTUVWXYZ'''



def     __lowerCAmelCase						(							)       ->							None:
   __lowerCamelCase:				Optional[int]     =	input("""Enter message: """ )
   __lowerCamelCase:				Dict     =	input("""Enter key [alphanumeric]: """ )
   __lowerCamelCase:				List[Any]     =	input("""Encrypt/Decrypt [e/d]: """ )

   if mode.lower().startswith("""e""" ):
      __lowerCamelCase:				Optional[int]     =	"""encrypt"""
      __lowerCamelCase:				Optional[int]     =	encrypt_message(snake_case						,      snake_case )
   elif mode.lower().startswith("""d""" ):
      __lowerCamelCase:				Union[str, Any]     =	"""decrypt"""
      __lowerCamelCase:				Optional[Any]     =	decrypt_message(snake_case						,      snake_case )

   print(f'\n{mode.title()}ed message:' )
   print(snake_case )



def     __lowerCAmelCase						(							snake_case	:    str						,      snake_case	:    str )       ->							str:
   return translate_message(snake_case						,      snake_case						,      """encrypt""" )



def     __lowerCAmelCase						(							snake_case	:    str						,      snake_case	:    str )       ->							str:
   return translate_message(snake_case						,      snake_case						,      """decrypt""" )



def     __lowerCAmelCase						(							snake_case	:    str						,      snake_case	:    str						,      snake_case	:    str )       ->							str:
   __lowerCamelCase:				Any     =	[]
   __lowerCamelCase:				Optional[int]     =	0
   __lowerCamelCase:				Any     =	key.upper()

   for symbol in message:
      __lowerCamelCase:				int     =	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(snake_case )

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

         key_index += 1
         if key_index == len(snake_case ):
            __lowerCamelCase:				Union[str, Any]     =	0
      else:
         translated.append(snake_case )
   return "".join(snake_case )


if __name__ == "__main__":
   main()


