days = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] days_leap = [0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] def is_leap_year(y): # 閏年判定 if y%400==0: return True elif y%100==0: return False elif y%4==0: return True else: return False def zeller(y, m, d): # ツェラーの公式 # 土曜日 -> 0 if m<=2: m += 12 y -= 1 C, Y = divmod(y, 100) h = (d + 26*(m+1)//10 + Y + Y//4 + (-2*C+C//4)) % 7 return h def md2d(m, d): # m 月 d 日は 0-indexed で何日目か? # 返り値は [0, 365) return sum(days[:m]) + d - 1 def all_md(): for m, ds in enumerate(days[1:], 1): for d in range(1, ds+1): yield m, d def all_ymd(y_start, y_end): for y in range(y_start, y_end): for m, d in all_md(days=days_leap if is_leap_year(y) else days): yield y, m, d y, m, d = map(int, input().split('/')) d += 2 if is_leap_year(y): if d > days_leap[m]: d -= days_leap[m] m += 1 else: if d > days[m]: d -= days[m] m += 1 if m == 13: m = 1 y += 1 print(f"{y}/{m:02}/{d:02}")