s = eval(input())

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



S = eval(input())

print(("2018" + S[4:]))
s = eval(input())
print((s.replace("2017", "2018")))

S = eval(input())
print(("2018" + S[4:]))

-s = eval(input()) -print((s.replace("2017", "2018"))) +S = eval(input()) +print(("2018" + S[4:]))