word_1, word_2 = input(), input()
print(word_2[0] + word_1[1:-1] + word_2[-1])
print(word_1[0] + word_2[1:-1] + word_1[-1])
word_1, word_2 = input(), input()
print(word_2[0] + word_1[1:-1] + word_2[-1])
print(word_1[0] + word_2[1:-1] + word_1[-1])