T = int(input()) for i in range(T): V, E = map(int, input().split()) a = 2 - V + E print(a)
2023-03-21