import datetime y,m,d= map(int, raw_input().strip().split()) now = datetime.date(y,m,d) delta = datetime.timedelta(days=1) n_days = now + delta print n_days.year,n_days.month,n_days.day