import datetime n = list(map(int,input().split())) today = datetime.date(n[0],n[1],n[2]) nextday = today + datetime.timedelta(days = 1) year = nextday.year month = nextday.month day = nextday.day print(year,int(month),int(day))