S = list(eval(input()))

S[3] = "8"

print(("".join(S)))
print((input().replace("2017", "2018")))
S = list(eval(input()))
S[3] = "8"
print(("".join(S)))

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

-S = list(eval(input())) -S[3] = "8" -print(("".join(S))) +print((input().replace("2017", "2018")))