q=int(input()) for i in range(q): t,*d=map(int,input().split()) if t==1:print(sum(d)) else:print(i+1)