#include #include using namespace std; bool leap(int Y){ return Y % 400 == 0 || Y % 100 != 0 && Y % 4 == 0; } void next(int &Y, int &M, int &D){ if (M == 2){ if (leap(Y)){ if (D == 29){ M++; D = 1; } else { D++; } } else { if (D == 28){ M++; D = 1; } else { D++; } } } else if (M == 4 || M == 6 || M == 9 || M == 11){ if (D == 30){ M++; D = 1; } else { D++; } } else if (M == 12){ if (D == 31){ Y++; M = 1; D = 1; } else { D++; } } else { if (D == 31){ M++; D = 1; } else { D++; } } } int main(){ int Y; char s1; int M; char s2; int D; cin >> Y >> s1 >> M >> s2 >> D; next(Y, M, D); next(Y, M, D); string Y2 = to_string(Y); while (Y2.size() < 4){ Y2 = '0' + Y2; } string M2 = to_string(M); while (M2.size() < 2){ M2 = '0' + M2; } string D2 = to_string(D); while (D2.size() < 2){ D2 = '0' + D2; } cout << Y2 << s1 << M2 << s2 << D2 << endl; }