str1 = input()
str2 = input()
answ = str1[:5]
if str2[0] == " ":
answ += str2[:6]
else:
answ += "" + str2[:5]
print(answ)
str1 = input()
str2 = input()
answ = str1[:5]
if str2[0] == " ":
answ += str2[:6]
else:
answ += "" + str2[:5]
print(answ)