import datetime s=list(map(int,input().split())) y,m,d=s[0],s[1],s[2] t=datetime.datetime(y,m,d) j=t+datetime.timedelta(days=1) j = str(j) y = int(j[0:4]) m = int(j[5:7]) d = int(j[8:10]) print(y,m,d)