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