
# T=int(input())
# for i in range(T) :
#     k,d0,d1 = map(int, input().split())
#     s=d0+d1
#     if s!=10 and k>2 :
#         temp=s%10
#         s=s+temp
#     if s!=10 and s!=20 :
#         s=s + 20*((k-3)//4)
#     x=(k-3)%4
#     for j in range(x) :
#         temp2=s%10
#         s+=temp2
#     if s%3 ==0 :
# 	    print('YES')
#     else :
# 	    print('NO')






