import datetime
date=input()
d=datetime.datetime.strptime(date,'%Y %m %d')
tomorrow=d+datetime.timedelta(days=1)
s=tomorrow.date().strftime('%Y %m %d')
list1=s.split()
list1[1]=int(list1[1])
list1[2]=int(list1[2])
print(str(list1[0])+" "+str(list1[1])+" "+str(list1[2]))