import datetime y,m,d=map(int,raw_input().strip().split()) now=datetime.datetime(y,m,d) nextday=now + datetime.timedelta(days=1) print str(nextday.year)+" "+str(nextday.month)+" "+str(nextday.day)