p = 323453257
x = 36503778
y = 131619160

X = 205125783
Y = 71774435

K = 0
Ks = 0

K = pow(Y,x,p)
Ks = pow(X,y,p)

print(K)
print(Ks)

p = 323453257
y = 9193750
x = 133632828

X = 302556493
Y = 158698368

K = pow(Y,x,p)
Ks = pow(X,y,p)

print(K)
print(Ks)
