s = eval(input())

s = s.replace("7", "8", 1)

print(s)
s = eval(input())

print(("2018" + s[4:]))
s = eval(input())
s = s.replace("7", "8", 1)
print(s)

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

-s = s.replace("7", "8", 1) -print(s) +print(("2018" + s[4:]))