import datetime y,m,d=map(int,input().split()) t = datetime.datetime(y,m,d) d = t + datetime.timedelta(days = +1) print (d.year,d.month,d.day)