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