DO
from itertools import product
symbols = [*range(0, 12)]
combs = list(product(symbols, repeat=7))
def jopa(elist):
s = elist[-1]
for i in elist[-2::-1]:
x = i if i < 20 else i % 20 + 20
y = s if s < 4 else s % 4 + 4
s = x ** y
return s % 10
def jopa1(seq: tuple, /) -> int:
if len(seq)<2: return
if len(seq)>3 and 0 not in seq[2:]: seq = seq[:3]
pwr = seq[-1]
for num in seq[-2::-1]:
a = num if num <= 20 else num % 20 + 20
b = pwr if pwr <= 4 else pwr % 4 + 4
pwr = a ** b
return pwr % 10
for nums in combs:
first, second = jopa(nums), jopa1(nums)
if first != second:
print('fuck', nums)
break
else:
print('cool')