import sys

l = []
keys = []
dicts = {}
for i in sys.stdin:
    l.append(i)

for i in range(1,len(l)):
    l[i] = l[i].split()

for i in range(1,len(l)):
    if l[i][0] not in keys:
        keys.append(l[i][0])

for i in range(1,len(l)):
    if l[i][0] not in dicts:
        a = []
        a.append(int(l[i][1]))
        dicts[l[i][0]] = a
    else:
        dicts[l[i][0]].append(int(l[i][1]))

for key in dicts:
    dicts[key] = sorted(dicts[key])

for data in keys:
    for j in range(1,14):
        if j not in dicts[data]:
            print(data,j)
