





from __future__ import annotations

import math
import random


def      SCREAMING_SNAKE_CASE      (   lowerCAmelCase     ,							lowerCAmelCase     ,							lowerCAmelCase       ):
       _UpperCamelCase														=    d * e - 1
       _UpperCamelCase														=    0
       _UpperCamelCase														=    0
       while p == 0:
              _UpperCamelCase														=    random.randint(2     ,							n - 1       )
              _UpperCamelCase														=    k
              while True:
                     if t % 2 == 0:
                            _UpperCamelCase														=    t // 2
                            _UpperCamelCase														=    (g**t) % n
                            _UpperCamelCase														=    math.gcd(x - 1     ,							lowerCAmelCase       )
                            if x > 1 and y > 1:
                                   _UpperCamelCase														=    y
                                   _UpperCamelCase														=    n // y
                                   break  # find the correct factors
                     else:
                            break  # t is not divisible by 2, break and choose another g
       return sorted([p, q]       )


if __name__ == "__main__":
       import doctest

       doctest.testmod()








"""simple docstring"""




def 				a__			(					lowerCAmelCase						:							str							,     lowerCAmelCase						:							int = 13		):






     '''simple docstring'''
     UpperCAmelCase__				:			Any							=    ""
     for c in s:
          if "A" <= c <= "Z":
               out += chr(ord("A"		) + (ord(lowerCAmelCase		) - ord("A"		) + n) % 26		)
          elif "a" <= c <= "z":
               out += chr(ord("a"		) + (ord(lowerCAmelCase		) - ord("a"		) + n) % 26		)
          else:
               out += c
     return out



def 				a__			(					):






     '''simple docstring'''
     UpperCAmelCase__				:			Optional[int]							=    input("Enter message: "		)

     UpperCAmelCase__				:			Optional[Any]							=    dencrypt(lowerCAmelCase							,     13		)
     print("Encryption:"							,     lowerCAmelCase		)

     UpperCAmelCase__				:			List[str]							=    dencrypt(lowerCAmelCase							,     13		)
     print("Decryption: "							,     lowerCAmelCase		)


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    main()



