#include #include using namespace std; int uruu(int y) { if (y % 4 == 0) { if (y % 100 == 0) { if (y % 400 == 0) { return 1; } return 0; } return 1; } return 0; } int main() { ios::sync_with_stdio(false); cin.tie(0); int days[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; string tmp; cin >> tmp; int m, d, y; d = stoi(tmp.substr(8, 2)); m = stoi(tmp.substr(5, 2)); if (d <= 26 || (d <= 27 && m != 2)) { cout << tmp.substr(0, 8); cout << setw(2) << setfill('0') << d + 2 << endl; } y = stoi(tmp.substr(0, 4)); if (m != 12) { int nd = (d + 2) % (m == 2 && uruu(y) == 1 ? 29 + 1 : days[m - 1] + 1); if (nd > d) { cout << tmp.substr(0, 8); cout << setw(2) << setfill('0') << d + 2 << endl; } else { //月が変わる nd++; cout << tmp.substr(0, 5); cout << setw(2) << setfill('0') << m + 1; cout << "/"; cout << setw(2) << setfill('0') << nd << endl; } } else { int nd = (d + 2) % (days[m - 1] + 1); if (nd > d) { cout << tmp.substr(0, 8); cout << setw(2) << setfill('0') << d + 2 << endl; } else { //年が変わる nd++; cout << setw(4) << setfill('0') << y + 1; cout << "/01/"; cout << setw(2) << setfill('0') << nd << endl; } } }