n = eval(input())

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

print((s.replace("7","8",1)))
n = eval(input())
print((n.replace("2017", "2018", 1)))

s = eval(input())
print((s.replace("7", "8", 1)))

-n = eval(input()) -print((n.replace("2017", "2018", 1))) +s = eval(input()) +print((s.replace("7", "8", 1)))