#include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair P; int dx[] = { 1, 0, -1, 0 }; int dy[] = { 0, 1, 0, -1 }; const ll MOD = 1000000007; const ll INF = 100000; int a, b; string s, sa, sb; int main(void){ cin >> sa >> sb >> s; a = stoi(sa); b = stoi(sb); string s2; for (int i = 4; i < s.size(); i++) s2 += s[i]; int jtime = a * 60 + b; int time = (int)(stod(s2) * 60); int ans = 0; if (s[3] == '+') ans += jtime + time - 540; else ans += jtime - time - 540; if (ans < 0) ans += 1440; else ans %= 1440; if (ans / 60 < 10) cout << '0'; cout << ans / 60 << ':'; if (ans % 60 < 10) cout << '0'; cout << ans % 60; }