def isNum(x):
return x.isdigit()
input = raw_input().split(' ')
output = set()
right = 'x'
for i in xrange(len(input) - 1, -1, -1):
if not isNum(input[i]):
right = 'x'
elif right == 'x':
right = input[i]
elif input[i] != right:
output.add((input[i], right))
print output
ZGVmIGlzTnVtKHgpOgogIHJldHVybiB4LmlzZGlnaXQoKQoKaW5wdXQgPSByYXdfaW5wdXQoKS5zcGxpdCgnICcpCm91dHB1dCA9IHNldCgpCnJpZ2h0ID0gJ3gnCmZvciBpIGluIHhyYW5nZShsZW4oaW5wdXQpIC0gMSwgLTEsIC0xKToKICBpZiBub3QgaXNOdW0oaW5wdXRbaV0pOgogICAgcmlnaHQgPSAneCcKICBlbGlmIHJpZ2h0ID09ICd4JzoKICAgIHJpZ2h0ID0gaW5wdXRbaV0KICBlbGlmIGlucHV0W2ldICE9IHJpZ2h0OgogICAgb3V0cHV0LmFkZCgoaW5wdXRbaV0sIHJpZ2h0KSkKCnByaW50IG91dHB1dA==