import re

line = raw_input()

answer = []

for block in re.findall(r'[\d+ ]+\D+', line):
    seq = block.split()[:-1]
    second = seq[-1]
    for first in seq[:-1]:
        if first != second:
            answer.append((first, second))

for tup in set(answer):
     print tup
