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

Difficulty: VERY_HARD
Tags: Implementation

Starter code:

Solutions:
A = ['a 1 0 0 1 0', 'b 1 1 0 2 0', 'c 2 0 0 1 1', 'd 2 1 0 1 2', 'e 1 1 0 1 1', 'f 2 1 0 2 1', 'g 2 2 0 2 2', 'h 1 2 0 2 1', 'i 1 1 0 1 1', 'j 1 2 0 1 2', 'k 1 0 1 2 0', 'l 1 1 1 3 0', 'm 2 0 1 2 1', 'n 2 1 1 2 2', 'o 1 1 1 2 1', 'p 2 1 1 3 1', 'q 2 2 1 3 2', 'r 1 2 1 3 1', 's 1 1 1 2 1', 't 1 2 1 2 2', 'u 1 0 2 2 1', 'v 1 1 2 3 1', 'w 1 2 1 1 3', 'x 2 0 2 2 2', 'y 2 1 2 2 3', 'z 1 1 2 2 2']
n = int(input())
inp = [input() for i in range(n)]
for a in inp:
	for b in A:
		if b[2:] == a:
			print(b[0], end='')
			break
print()


d = {'i': (1, 1, 0, 1, 1), 'a': (1, 0, 0, 1, 0), 'b': (1, 1, 0, 2, 0), 'c': (2, 0, 0, 1, 1), 'd': (2, 1, 0, 1, 2), 'e': (1, 1, 0, 1, 1), 'f': (2, 1, 0, 2, 1), 'g': (2, 2, 0, 2, 2), 'h': (1, 2, 0, 2, 1), 'j': (1, 2, 0, 1, 2), 's': (1, 1, 1, 2, 1), 'k': (1, 0, 1, 2, 0), 'l': (1, 1, 1, 3, 0), 'm': (2, 0, 1, 2, 1), 'n': (2, 1, 1, 2, 2), 'o': (1, 1, 1, 2, 1), 'p': (2, 1, 1, 3, 1), 'q': (2, 2, 1, 3, 2), 'r': (1, 2, 1, 3, 1), 't': (1, 2, 1, 2, 2), 'u': (1, 0, 2, 2, 1), 'v': (1, 1, 2, 3, 1), 'x': (2, 0, 2, 2, 2), 'y': (2, 1, 2, 2, 3), 'z': (1, 1, 2, 2, 2), 'w': (1, 2, 1, 1, 3)}
ks = d.keys()
invdict = dict(zip([d[k] for k in ks], ks))
n = int(input())
res = ''
for i in range(n):
	a = tuple([int(k) for k in input().split()])
	res += invdict[a]
print(res)


import sys
from math import *
import threading
from itertools import count
from pprint import pprint
from collections import defaultdict
from heapq import heapify, heappop, heappush
sys.setrecursionlimit(300000)
mod = 10 ** 9 + 7
inf = 10 ** 15
decision = ['NO', 'YES']
yes = 'YES'
no = 'NO'
import os
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def npr(n, r):
	return factorial(n) // factorial(n - r) if n >= r else 0

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(n - r)) if n >= r else 0

def lower_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			answer = middle
			start = middle + 1
		else:
			end = middle - 1
	return answer

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val):
	ans = -1
	lb = 0
	ub = len(li) - 1
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = mid
			break
	return ans

def kadane(x):
	sum_so_far = 0
	current_sum = 0
	for i in x:
		current_sum += i
		if current_sum < 0:
			current_sum = 0
		else:
			sum_so_far = max(sum_so_far, current_sum)
	return sum_so_far

def pref(li):
	pref_sum = [0]
	for i in li:
		pref_sum.append(pref_sum[-1] + i)
	return pref_sum

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	li = []
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, len(prime)):
		if prime[p]:
			li.append(p)
	return li

def primefactors(n):
	factors = []
	while n % 2 == 0:
		factors.append(2)
		n //= 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			factors.append(i)
			n //= i
	if n > 2:
		factors.append(n)
	return factors

def prod(li):
	ans = 1
	for i in li:
		ans *= i
	return ans

def sumk(a, b):
	print('called for', a, b)
	ans = a * (a + 1) // 2
	ans -= b * (b + 1) // 2
	return ans

def sumi(n):
	ans = 0
	if len(n) > 1:
		for x in n:
			ans += int(x)
		return ans
	else:
		return int(n)
karmanya = 0
for _ in range(int(input()) if karmanya else 1):
	l = ['100000', '101000', '110000', '110100', '100100', '111000', '111100', '101100', '011000', '011100', '100010', '101010', '110010', '110110', '100110', '111010', '111110', '101110', '011010', '011110', '100011', '101011', '011101', '110011', '110111', '100111']
	l = [[int(x) for x in st] for st in l]
	n = int(input())
	for _ in range(n):
		(x, y, z, a, b) = map(int, input().split())
		for (idx, t) in enumerate(l):
			if t[0] + t[1] == x and t[2] + t[3] == y and (t[4] + t[5] == z) and (t[0] + t[2] + t[4] == a) and (t[1] + t[3] + t[5] == b):
				print(chr(97 + idx), end='')
				break
	print()


l = ['1 0 0 1 0', '1 1 0 2 0', '2 0 0 1 1', '2 1 0 1 2', '1 1 0 1 1', '2 1 0 2 1', '2 2 0 2 2', '1 2 0 2 1', '1 1 0 1 1', '1 2 0 1 2', '1 0 1 2 0', '1 1 1 3 0', '2 0 1 2 1', '2 1 1 2 2', '1 1 1 2 1', '2 1 1 3 1', '2 2 1 3 2', '1 2 1 3 1', '1 1 1 2 1', '1 2 1 2 2', '1 0 2 2 1', '1 1 2 3 1', '1 2 1 1 3', '2 0 2 2 2', '2 1 2 2 3', '1 1 2 2 2']
n = int(input())
for i in range(n):
	s = input().strip()
	ok = False
	for j in range(26):
		if s == l[j]:
			print(chr(ord('a') + j), end='')
			ok = True
			break
	assert ok


code_table = {'100000': 'a', '110000': 'b', '100100': 'c', '100110': 'd', '100010': 'e', '110100': 'f', '110110': 'g', '110010': 'h', '010100': 'i', '010110': 'j', '101000': 'k', '111000': 'l', '101100': 'm', '101110': 'n', '101010': 'o', '111100': 'p', '111110': 'q', '111010': 'r', '011100': 's', '011110': 't', '101001': 'u', '111001': 'v', '010111': 'w', '101101': 'x', '101111': 'y', '101011': 'z'}
n = int(input())
for i in range(n):
	(x1, x2, x3, y1, y2) = map(int, input().split())
	for (b, v) in code_table.items():
		b = list(map(int, b))
		xx1 = b[0] + b[3]
		xx2 = b[1] + b[4]
		xx3 = b[2] + b[5]
		yy1 = b[0] + b[1] + b[2]
		yy2 = b[3] + b[4] + b[5]
		if xx1 == x1 and xx2 == x2 and (xx3 == x3) and (yy1 == y1) and (yy2 == y2):
			print(v, end='')
			break
print('')


for s in [*open(0)][1:]:
	print(chr(97 + ['10010', '11020', '20011', '21012', '11011', '21021', '22022', '12021', '00000', '12012', '10120', '11130', '20121', '21122', '11121', '21131', '22132', '12131', '11111', '12122', '10221', '11231', '12113', '20222', '21223', '11222'].index(s[:-1].replace(' ', ''))), end='')


a = ['10010', '11020', '20011', '21012', '11011', '21021', '22022', '12021', '00000', '12012', '10120', '11130', '20121', '21122', '11121', '21131', '22132', '12131', '11111', '12122', '10221', '11231', '12113', '20222', '21223', '11222']
n = int(input())
for i in range(n):
	f = input().replace(' ', '')
	print(chr(97 + a.index(f)), end='')


n = int(input())
d = dict()
d['10010'] = 'a'
d['11020'] = 'b'
d['20011'] = 'c'
d['21012'] = 'd'
d['11011'] = 'e'
d['21021'] = 'f'
d['22022'] = 'g'
d['12021'] = 'h'
d['12012'] = 'j'
d['10120'] = 'k'
d['11130'] = 'l'
d['20121'] = 'm'
d['21122'] = 'n'
d['11121'] = 'o'
d['21131'] = 'p'
d['22132'] = 'q'
d['12131'] = 'r'
d['12122'] = 't'
d['10221'] = 'u'
d['11231'] = 'v'
d['12113'] = 'w'
d['20222'] = 'x'
d['21223'] = 'y'
d['11222'] = 'z'
result = ''
for i in range(n):
	result += d[input().replace(' ', '')]
print(result)


q = {'1 0 0 1 0': 'a', '1 1 0 2 0': 'b', '2 0 0 1 1': 'c', '2 1 0 1 2': 'd', '1 1 0 1 1': 'e', '2 1 0 2 1': 'f', '2 2 0 2 2': 'g', '1 2 0 2 1': 'h', '1 2 0 1 2': 'j', '1 0 1 2 0': 'k', '1 1 1 3 0': 'l', '2 0 1 2 1': 'm', '2 1 1 2 2': 'n', '1 1 1 2 1': 'o', '2 1 1 3 1': 'p', '2 2 1 3 2': 'q', '1 2 1 3 1': 'r', '1 2 1 2 2': 't', '1 0 2 2 1': 'u', '1 1 2 3 1': 'v', '2 0 2 2 2': 'x', '2 1 2 2 3': 'y', '1 1 2 2 2': 'z', '1 2 1 1 3': 'w'}
print(''.join([q[input()] for i in range(int(input()))]))


a = ['10010', '11020', '20011', '21012', '11011', '21021', '22022', '12021', '00000', '12012', '10120', '11130', '20121', '21122', '11121', '21131', '22132', '12131', '11111', '12122', '10221', '11231', '12113', '20222', '21223', '11222']
from string import ascii_lowercase as l
n = int(input())
r = ''
for i in range(n):
	(*b,) = map(int, input().split())
	s = ''.join(map(str, b))
	r += l[a.index(s)]
print(r)


braille = [['a', '1'], ['b', '12'], ['c', '14'], ['d', '145'], ['e', '15'], ['f', '124'], ['g', '1245'], ['h', '125'], ['i', '24'], ['j', '245'], ['k', '13'], ['l', '123'], ['m', '134'], ['n', '1345'], ['o', '135'], ['p', '1234'], ['q', '12345'], ['r', '1235'], ['s', '234'], ['t', '2345'], ['u', '136'], ['v', '1236'], ['w', '2456'], ['x', '1346'], ['y', '13456'], ['z', '1356']]
decoded = {}
for (ch, enc) in braille:
	final = [0] * 5
	for idx in enc:
		idx = ord(idx) - ord('1')
		r = idx % 3
		c = idx // 3
		final[r] += 1
		final[c + 3] += 1
	if tuple(final) not in decoded:
		decoded[tuple(final)] = ch
n = int(input())
ans = ''
for i in range(n):
	(a, b, c, d, e) = map(int, input().split())
	ans += decoded[a, b, c, d, e]
print(ans)


table = {(1, 0, 0, 1, 0): 'a', (1, 1, 0, 2, 0): 'b', (2, 0, 0, 1, 1): 'c', (2, 1, 0, 1, 2): 'd', (1, 1, 0, 1, 1): 'e', (2, 1, 0, 2, 1): 'f', (2, 2, 0, 2, 2): 'g', (1, 2, 0, 2, 1): 'h', (1, 2, 0, 1, 2): 'j', (1, 0, 1, 2, 0): 'k', (1, 1, 1, 3, 0): 'l', (2, 0, 1, 2, 1): 'm', (2, 1, 1, 2, 2): 'n', (1, 1, 1, 2, 1): 'o', (2, 1, 1, 3, 1): 'p', (2, 2, 1, 3, 2): 'q', (1, 2, 1, 3, 1): 'r', (1, 2, 1, 2, 2): 't', (1, 0, 2, 2, 1): 'u', (1, 1, 2, 3, 1): 'v', (1, 2, 1, 1, 3): 'w', (2, 0, 2, 2, 2): 'x', (2, 1, 2, 2, 3): 'y', (1, 1, 2, 2, 2): 'z'}
for item in table:
	if item[0] + item[1] + item[2] != item[3] + item[4]:
		print(table[item])
		exit(1)
ans = []
for _ in range(int(input())):
	a = tuple(map(int, input().split()))
	ans.append(table[a])
print(''.join(ans))


alphaToBraille = {'a': '1', 'b': '12', 'c': '14', 'd': '145', 'e': '15', 'f': '124', 'g': '1245', 'h': '125', 'i': '24', 'j': '245', 'k': '13', 'l': '123', 'm': '134', 'n': '1345', 'o': '135', 'p': '1234', 'q': '12345', 'r': '1235', 's': '234', 't': '2345', 'u': '136', 'v': '1236', 'w': '2456', 'x': '1346', 'y': '13456', 'z': '1356'}
decode = {}
for (ch, code) in alphaToBraille.items():
	rows = [0, 0, 0]
	cols = [0, 0]
	for c in range(2):
		for r in range(3):
			i = c * 3 + r + 1
			rows[r] += str(i) in code
			cols[c] += str(i) in code
	line = ' '.join(map(str, rows + cols))
	if line in decode:
		continue
	decode[line] = ch
(N,) = [int(x) for x in input().split()]
print(''.join((decode[input()] for i in range(N))))


l = ['100000', '101000', '110000', '110100', '100100', '111000', '111100', '101100', '011000', '011100', '100010', '101010', '110010', '110110', '100110', '111010', '111110', '101110', '011010', '011110', '100011', '101011', '011101', '110011', '110111', '100111']
l = [[int(x) for x in st] for st in l]
n = int(input())
for _ in range(n):
	(x, y, z, a, b) = map(int, input().split())
	for (idx, t) in enumerate(l):
		if t[0] + t[1] == x and t[2] + t[3] == y and (t[4] + t[5] == z) and (t[0] + t[2] + t[4] == a) and (t[1] + t[3] + t[5] == b):
			print(chr(97 + idx), end='')
			break
print()


import sys
from typing import List
braille_chars = '\n.  .  .. .. .  .. .. .   .  . .  .  .. .. .  .. .. .   .  . .  .   . .. .. .  \n   .      .  . .  .. .. .  ..    .      .  . .  .. .. .  ..    .  ..     .  . \n                              .  .  .  .  .  .  .  .  .  .  .. ..  . .. .. .. \n'.strip().splitlines()
decode_chart = {}
for idx in range(26):
	ch = chr(idx + ord('a'))
	if ch in 'is':
		continue
	shape = [braille_chars[l][3 * idx:3 * idx + 2] for l in range(3)]
	shape = [[x == '.' for x in line] for line in shape]
	rows = [sum(line) for line in shape]
	cols = [sum((shape[r][c] for r in range(3))) for c in range(2)]
	code = tuple(rows) + tuple(cols)
	decode_chart[code] = ch

def solve_G(codes: List[List[int]]) -> str:
	return ''.join((decode_chart[tuple(code)] for code in codes))
input_str = sys.stdin.read().strip()
codes = [[int(x) for x in line.split()] for line in input_str.splitlines()[1:]]
print(solve_G(codes))


import sys
pin = sys.stdin.readline
N = int(pin())
D = {'1 0 0 1 0': 'a', '1 1 0 2 0': 'b', '2 0 0 1 1': 'c', '2 1 0 1 2': 'd', '1 1 0 1 1': 'e', '2 1 0 2 1': 'f', '2 2 0 2 2': 'g', '1 2 0 2 1': 'h', '1 2 0 1 2': 'j', '1 0 1 2 0': 'k', '1 1 1 3 0': 'l', '2 0 1 2 1': 'm', '2 1 1 2 2': 'n', '1 1 1 2 1': 'o', '2 1 1 3 1': 'p', '2 2 1 3 2': 'q', '1 2 1 3 1': 'r', '1 2 1 2 2': 't', '1 0 2 2 1': 'u', '1 1 2 3 1': 'v', '1 2 1 1 3': 'w', '2 0 2 2 2': 'x', '2 1 2 2 3': 'y', '1 1 2 2 2': 'z'}
L = [D[pin().strip()] for _ in range(N)]
print(''.join(L))


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))


t = {1: 0, 5: 1, 3: 2, 11: 3, 9: 4, 7: 5, 15: 6, 13: 7, 14: 9, 1 + 16: 10, 5 + 16: 11, 3 + 16: 12, 11 + 16: 13, 9 + 16: 14, 7 + 16: 15, 15 + 16: 16, 13 + 16: 17, 14 + 16: 19, 1 + 48: 20, 5 + 48: 21, 3 + 48: 23, 11 + 48: 24, 9 + 48: 25, 46: 22}

def c(v, h, n):
	return v == [bool(n & 1 << 0) + bool(n & 1 << 1), bool(n & 1 << 2) + bool(n & 1 << 3), bool(n & 1 << 4) + bool(n & 1 << 5)] and h == [bool(n & 1 << 0) + bool(n & 1 << 2) + bool(n & 1 << 4), bool(n & 1 << 1) + bool(n & 1 << 3) + bool(n & 1 << 5)]

def solve(s):
	s = [ord(c) - ord('0') for c in s]
	v = [s[0], s[2], s[4]]
	h = [s[6], s[8]]
	for n in range(64):
		if c(v, h, n) and n in t:
			break
	else:
		print('wtf')
	return chr(t[n] + ord('a'))
n = int(input())
s = ''
for _ in range(n):
	s += solve(input())
print(s)