#include #include #include #include #include #include #include #include #include #include #include #include #include #define p(s) cout<<(s)<=n;i--) #define CK(n,a,b) ((a)<=(n)&&(n)<(b)) #define F first #define S second typedef long long ll; using namespace std; const int inf=1e9+7; int a,b; int h,m; int main(){ scanf("%d %d UTC%d.%d",&a, &b, &h, &m); if(h<0) m=-m; int minute = (a+h-9)*60+ m*6 + b; minute += 1440*2; minute %= 1440; printf("%02d:%02d\n", minute/60, minute%60); return 0; }