#include using namespace std; int main() { int a, b; string S; cin >> a >> b >> S; struct tm t = {}; t.tm_hour = a - 9; t.tm_min = b + (stod(S.substr(3))) * 60; mktime(&t); printf("%02d:%02d", t.tm_hour, t.tm_min); }