#include #define rep(i, a, n) for(int i = a; i < n; i++) #define REP(i, n) rep(i, 0, n) #define repb(i, a, b) for(int i = a; i >= b; i--) #define all(a) a.begin(), a.end() #define chmax(x, y) x = max(x, y) #define chmin(x, y) x = min(x, y) using namespace std; typedef pair P; const int mod = 1000000007; signed main(){ int a, b; string s; cin >> a >> b >> s; s = s.substr(3); bool f = true; if(s[0] == '-') f = false; s = s.substr(1); int tmp = s[0] - '0'; s = s.substr(1); if(s != "" && isdigit(s[0])){ tmp = tmp * 10 + s[0] - '0'; s = s.substr(1); } tmp *= 60; if(s != "" && s[0] == '.'){ tmp = tmp + 6 * (s[1] - '0'); } if(f == false) tmp *= -1; tmp = (tmp - 540 + 60 * 24) % (60 * 24); b += tmp % 60; a += tmp / 60; if(b >= 60){ a++; b %= 60; } a %= 24; printf("%02d:%02d\n", a, b); }