'''simple docstring'''
def 				__UpperCamelCase (					__UpperCAmelCase  :					str			)							->	int:
  lowercase				:							Optional[int]									=   0
  for letter in data:
    lowercase				:							Union[str, Any]									=   (hash_ << 4) + ord(__UpperCAmelCase			)
    lowercase				:							Union[str, Any]									=   hash_ & 0Xf000_0000
    if x != 0:
      hash_ ^= x >> 24
    hash_ &= ~x
  return hash_


if __name__ == "__main__":
 import doctest

 doctest.testmod()
'''simple docstring'''
from __future__ import annotations

import math
import random







def 				__UpperCamelCase (					__UpperCAmelCase  :					int ,   __UpperCAmelCase  :					int ,   __UpperCAmelCase  :					int			)							->	list[int]:
  lowercase				:							Union[str, Any]									=   d * e - 1
  lowercase				:							List[str]									=   0
  lowercase				:							Tuple									=   0
  while p == 0:
    lowercase				:							Optional[Any]									=   random.randint(2 ,   n - 1			)
    lowercase				:							Dict									=   k
    while True:
      if t % 2 == 0:
        lowercase				:							List[Any]									=   t // 2
        lowercase				:							Union[str, Any]									=   (g**t) % n
        lowercase				:							Optional[Any]									=   math.gcd(x - 1 ,   __UpperCAmelCase			)
        if x > 1 and y > 1:
          lowercase				:							Dict									=   y
          lowercase				:							Any									=   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()