

Input

The first line of the input contains a single integer N (1 ≤ N ≤ 24). The next N lines contain 5 space-separated integers each. The first three integers will be between 0 and 2, inclusive. The last two integers will be between 0 and 3, inclusive. The sum of the first three integers will be equal to the sum of the last two integers.

Output

Output the result – a string of lowercase English letters.

Examples

Input


1
1 0 0 1 0


Output


a


Input


10
2 0 0 1 1
1 1 1 2 1
2 1 0 1 2
1 1 0 1 1
2 1 0 2 1
1 1 1 2 1
1 2 1 3 1
2 0 0 1 1
1 1 0 1 1
1 1 2 2 2


Output


codeforcez
Y='1 11 1001 11001 10001 1011 11011 10011 1010 11010 101 111 1101 11101 10101 1111 11111 10111 1110 11110 100101 100111 111010 101101 111101 110101'
X=list(map(lambda x:int(x,2),Y.split()))
N=int(input())
ANS=[]
for i in range(N):
  a,b,c,d,e=map(int,input().split())
  A=[a,b,c]
  B=[d,e]
  for j in range(26):
    C,D=[0,0,0],[0,0]
    for k in range(6):
      C[k%3]+=(X[j]>>k)&1
      D[k//3]+=(X[j]>>k)&1
    if A==C and B==D:
      ANS.append(chr(ord('a')+j))
      break
print(''.join(ANS))