print((input().replace("2017","2018")))
s=eval(input())

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

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

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