#include #include #include #include #include #include #include #include #include #include #include #define FOR(i, a, b) for(int i=(a);i<=(b);i++) #define RFOR(i, a, b) for(int i=(a);i>=(b);i--) #define MOD 1000000007 #define INF 1000000000 using namespace std; int main(void) { char t[6]; char s[6]; s[2] = ':'; s[5] = '\0'; cin >> t; if (t[3] == '5'&&t[4] >= '5') { if (t[0] == '2'&&t[1] == '3') { s[0] = '0'; s[1] = '0'; } else if (t[1] == '9') { s[0] = t[0] + 1; s[1] = '0'; } else { s[0] = t[0]; s[1] = t[1] + 1; } s[3] = '0'; s[4] = t[4] - 5; } else if (t[4] >= '5') { s[0] = t[0]; s[1] = t[1]; s[3] = t[3] + 1; s[4] = t[4] - 5; } else { s[0] = t[0]; s[1] = t[1]; s[3] = t[3]; s[4] = t[4] + 5; } cout << s << endl; return 0; }