#include #include #include #include #include #include #include #include #define ALL(x) (x).begin(),(x).end() #define RALL(x) (x).rbegin(),(x).rend() #define REP(i,a,n) for(int i = (a);i < (n);i++) #define PI 3.14159265359 #define MOD 1000000007 #define chmax(a,b) if(a < b)a = b using namespace std; int main(){ int a,b; char c; double d; scanf("%d %d UTC%c%lf",&a,&b,&c,&d); a = (24+a)*60 + b; d *= c == '-' ? -1 : 1; d = 9 - d; a -= 60*d; b = a%60; a /= 60; a %= 24; printf("%02d:%02d\n",a,b); return 0; }