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