print((input().replace("2017", "2018")))
S = input().replace("2017", "2018")

print(S)
print((input().replace("2017", "2018")))

S = input().replace("2017", "2018")
print(S)

-print((input().replace("2017", "2018"))) +S = input().replace("2017", "2018") +print(S)