s = list(input())

s[3] = "8"

print(*s, sep="")

s = eval(input())

print(("2018"+s[4:]))
s = list(input())
s[3] = "8"
print(*s, sep="")

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

-s = list(input()) -s[3] = "8" -print(*s, sep="") +s = eval(input()) +print(("2018" + s[4:]))