문제링크: https://www.acmicpc.net/problem/1009


T = int(input())

while T >0:
T-=1
a=int(input())
b=int(input())

if a==1or 5 or 6:
print(a)
elif a==4 or 9:
if b%2==0:
print(a^2 %10)
else:
print(a)

if a==2 or 3 or 7 or 8:
if b%4==0:
print(a^4 %10)
else:b=b%4
print(a^b %10)

문제에서

5 1 6 3 7 6 2 7 100 9 635

이렇게 입력받으라는데 어떻게 고쳐야하나요