#include #include using namespace std; int a,b,c,d; float x; main() { scanf("%d %d UTC%f",&a,&b,&x); x=9.0-x; c=x; if(c>=0)d=x*10-c*10; else d=(c+1)*10-x*10; b=b-d*6; if(b<0)b+=60,a--; a=(a-c+24)%24; printf("%02d:%02d\n",a,b); }