#!/usr/bin/python
#-*-coding:utf-8 -*-
import time
import datetime
y,m,d =map(int,raw_input().strip().split())
today= datetime.date(y,m,d)
tomorrow = today + datetime.timedelta(days=1)
print ("%s %s %s" % (tomorrow.year, tomorrow.month, tomorrow.day) )