#define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define EVAL 1 using namespace std; #define Ma_PI 3.141592653589793 #define eps 0.000001 #define LONG_INF 3000000000000000000 #define GOLD 1.61803398874989484820458 #define MAX_MOD 1000000007LL #define REP(i,n) for(long long i = 0;i < n;++i) #define seg_size 1048576 #define PI 3.1415926535 int main() { #define int long long int a, b; cin >> a >> b; string s; cin >> s; string c; int poo = 0; for (int i = 3;i < s.length();++i) { if (s[i] != '.') { c.push_back(s[i]); } else poo = 1; } int gee = stoi(c); if (poo == 0) { a += gee; a -= 9; a += 48; a %= 24; } else { int moo = abs(gee) / 10; if (gee < 0) moo = -moo; a += moo; a -= 9; a += 48; a %= 24; moo = abs(gee) % 10 * 6; if (gee < 0) moo = -moo; b += moo; if (b < 0) { b += 60; a--; a += 24; a %= 24; } if (b >= 60) { b -= 60; a++; a %= 24; } } if (a / 10 == 0) { cout << "0"; } cout << a << ":"; if (b / 10 == 0) { cout << "0"; } cout << b << endl; return 0; }