
import random






class UpperCAmelCase   :





   '''simple docstring'''


   @staticmethod
   def  __magic_name__				(					lowerCAmelCase_     :							str     ):

      """simple docstring"""
      _A:  Union[str, Any]					=       [ord(__lowercase     ) for i in text]
      _A:  str					=       []
      _A:  Optional[Any]					=       []
      for i in plain:
         _A:  str					=       random.randint(1			,			3_0_0     )
         _A:  List[str]					=       (i + k) * k
         cipher.append(__lowercase     )
         key.append(__lowercase     )
      return cipher, key


   @staticmethod
   def  __magic_name__				(					lowerCAmelCase_     :							list[int]			,			lowerCAmelCase_     :							list[int]     ):

      """simple docstring"""
      _A:  List[str]					=       []
      for i in range(len(__lowercase     )     ):
         _A:  Tuple					=       int((cipher[i] - (key[i]) ** 2) / key[i]     )
         plain.append(chr(__lowercase     )     )
      return "".join(__lowercase     )


if __name__ == "__main__":
   UpperCAmelCase__		:     Any     			=      Onepad().encrypt('Hello')
   print(c, k)
   print(Onepad().decrypt(c, k))











def 				lowerCamelCase__      (    __lowerCamelCase			:     Tuple  ,		__lowerCamelCase			:     Union[str, Any]		):
  __UpperCAmelCase							:	Tuple           =  [1]
  for i in range(2  ,		__lowerCamelCase		):
    factorials.append(factorials[-1] * i		)
  assert 0 <= k < factorials[-1] * n, "k out of bounds"

  __UpperCAmelCase							:	Optional[Any]           =  []
  __UpperCAmelCase							:	str           =  list(range(__lowerCamelCase		)		)

  # Find permutation
  while factorials:
    __UpperCAmelCase							:	Any           =  factorials.pop()
    __UpperCAmelCase      , __UpperCAmelCase							:	Optional[Any]           =  divmod(__lowerCamelCase  ,		__lowerCamelCase		)
    permutation.append(elements[number]		)
    elements.remove(elements[number]		)
  permutation.append(elements[0]		)

  return permutation


if __name__ == "__main__":
       import doctest

       doctest.testmod()


