#include using namespace std; int main(){ double a, b; string t; cin >> a >> b >> t; double utc = (stod(t.substr(3, t.size()))) - 9.0; double difmin = (utc*10*6); b += difmin; if(b >= 60){ a += b/60; b -= b/60 * 60; }else if(b < 0){ while(b < 0){ a--; b += 60.0; } } if(a < 0) a += 24; if(a > 24) a -= 24; cout << (10 > a ? "0" : "") << a << ":" << (10 > b ? "0" : "") << b << endl; return 0; }