print((function (f, g) local h,t = f(),g(tonumber) if h[t.d] then h[t.d](t) end return ("%d/%02d/%02d"):format(t.y,t.m,t.d) end)(function () function isLY(t) if t.y%100==0 then return t.y%400==0 end return t.y%4==0 end function is30(t) return t.m==4 or t.m==6 or t.m==9 or t.m==11 end return { [29] = function (t) if t.m==2 and (not isLY(t)) then t.m,t.d = 3,1 end end; [30] = function (t) if t.m==2 then t.m,t.d = 3,isLY(t) and 1 or 2 end end; [31] = function (t) if t.m==2 then t.m,t.d = 3,2 elseif is30(t) then t.m,t.d = t.m+1,1 end end; [32] = function (t) if t.m==12 then t.y,t.m,t.d = t.y+1,1,1 elseif is30(t) then t.m,t.d = t.m+1,2 else t.m,t.d = t.m+1,1 end end; [33] = function (t) if t.m==12 then t.y,t.m,t.d = t.y+1,1,2 elseif is30(t) then t.m,t.d = t.m+1,3 else t.m,t.d = t.m+1,2 end end } end, function (f) local y,m,d = io.stdin:read("*l"):match("(%d+)%/(%d+)%/(%d+)") return { y=f(y); m=f(m); d=f(d)+2 } end))