#coding=utf-8 import datetime y,m,d=map(int,raw_input().strip().split()) d = datetime.datetime(y,m,d) + datetime.timedelta(days = +1) print d.year,d.month,d.day