n = int(input()); x = [] for i in range(n) : x.append(input()) print(x[i].split(' ')[1])