#include using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int a,b; string s; cin >> a >> b >> s; string t = s.substr(4); int h,m; bool flag = false; for (int i = 0;i < t.size();i++){ if (i == 0) h = t[i] - '0'; else if (t[i] == '.') flag = true; else if (flag) m = (t[i] - '0') * 6; else {h *= 10;h += t[i] - '0';} } if (s[3] == '-') {h *= -1; m *= -1;} a += h - 9; b += m; if (b >= 60) { a += b/60; b %= 60; } if (b < 0) { a += b/60 - 1; b += 60*(-b/60 + 1); } if (a >= 24) { a = a-24; } if (a < 0) a += 24; if (a < 10) cout << '0' << a << ':' ; else cout << a << ':' ; if (b < 10) cout << '0' << b << endl; else cout << b << endl; return 0; }