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