#!/usr/bin/python # -*- coding: UTF-8 -*- from datetime import * import datetime import time y,m,d=map(int,raw_input().strip().split()) now=date(y,m,d) delta = datetime.timedelta(days=1) days=now+delta print days.year,days.month,days.day