import datetime t=raw_input() a=datetime.datetime.strptime(t,'%Y %m %d') b= a+datetime.timedelta(days=1) print b.year,b.month,b.day