import fileinput
words = set()
for line in fileinput.input():
    words.update(line.split())

compounds = set()
words = list(words)
for idx, w in enumerate(words):
    for w1 in words[idx+ 1:]:
        compounds.add(w + w1)
        compounds.add(w1 + w)

print("\n".join(sorted(list(compounds))))

7933d6a8289c7c460cccd098d7a49d02b0484828
<mask token>

<mask token>
for line in fileinput.input():
    words.update(line.split())
<mask token>
for idx, w in enumerate(words):
    for w1 in words[idx + 1:]:
        compounds.add(w + w1)
        compounds.add(w1 + w)
print('\n'.join(sorted(list(compounds))))

<mask token>
words = set()
for line in fileinput.input():
    words.update(line.split())
compounds = set()
words = list(words)
for idx, w in enumerate(words):
    for w1 in words[idx + 1:]:
        compounds.add(w + w1)
        compounds.add(w1 + w)
print('\n'.join(sorted(list(compounds))))

import fileinput
words = set()
for line in fileinput.input():
    words.update(line.split())
compounds = set()
words = list(words)
for idx, w in enumerate(words):
    for w1 in words[idx + 1:]:
        compounds.add(w + w1)
        compounds.add(w1 + w)
print('\n'.join(sorted(list(compounds))))

import fileinput
words = set()
for line in fileinput.input():
    words.update(line.split())

compounds = set()
words = list(words)
for idx, w in enumerate(words):
    for w1 in words[idx+ 1:]:
        compounds.add(w + w1)
        compounds.add(w1 + w)

print("\n".join(sorted(list(compounds))))
