summaryrefslogtreecommitdiff
path: root/25_2020.py
blob: 6a20d11086aa9c1ef4047865ce87f9bdcb72aeec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import re
import sys


def transform(x, sz):
    return pow(x, sz, 20201227)


k1, k2 = [int(x) for x in sys.stdin.read().strip().split("\n")]
# k1,k2 = 5764801,17807724

l1 = 0
while transform(7, l1) != k1:
    l1 += 1

l2 = 0
while transform(7, l2) != k2:
    l2 += 1

encryption = transform(k1, l2)
assert encryption == transform(k2, l1)
print(encryption)