s = eval(input())

print((str(int(s[:4]) + 1) +  s[4:]))
print(("2018/01/" + input()[-2:]))
s = eval(input())
print((str(int(s[:4]) + 1) + s[4:]))

print(("2018/01/" + input()[-2:]))

-s = eval(input()) -print((str(int(s[:4]) + 1) + s[4:])) +print(("2018/01/" + input()[-2:]))