a,b,c=map(int,raw_input().strip().split()) import datetime t=datetime.datetime(a,b,c) d=t + datetime.timedelta(days =+ 1) print d.year,d.month,d.day