import datetime sj=list(map(int,input().split())) t1=datetime.datetime(sj[0],sj[1],sj[2]) t2=t1+datetime.timedelta(days=1) print(t2.year,t2.month,t2.day)