#include #define rep(i, n) for(int i = 0; i < (int)(n); i++) using namespace std; typedef long long ll; int INF = (1LL << 30) - 1; int MOD = 1e9+7; int parse(string S){ int num = 0; bool flag = 0; for(auto c:S){ if(c == '.')flag = 1; else if(flag){ num += (c - '0') * 6; }else{ num *= 10; num += (c - '0') * 60; } } return num; } main(){ int a,b; string S; cin >> a >> b >> S; int time = a * 60 + b; //int dif = (int)(stof(S.substr(3) ) * 60); int dif = parse(S.substr(4)); if(S[3] == '-')dif *= -1; time += dif - 60*9; time = (time + 60*24) % (60*24); printf("%02d:%02d\n" ,time/60 ,time%60); }