fork download
  1. a=int(input())
  2. for i in range(a):
  3. b=input()
  4. s,w=b.split(' ')
  5. l1=eval(s[-1])
  6. l2=eval(w[-1])
  7. if l2==0:
  8. print(1)
  9. else:
  10. if len(w)>1:
  11. l2=eval(w[-2:])
  12. l2=l2%4;
  13. print(l1,l2)
Success #stdin #stdout 0.02s 5764KB
stdin
1
25625 656454
stdout
5 2