#include using namespace std; #define mp make_pair #define pb push_back #define all(x) (x).begin(),(x).end() #define YES() printf("YES\n") #define NO() printf("NO\n") #define Yes() printf("Yes\n") #define No() printf("No\n") #define in(x,y,h,w) x >= 0 && x < h && y >= 0 && y < w #define int long long //typedef long long ll; typedef vector vb; typedef vector vi; typedef vector vvb; typedef vector vvi; typedef pair P; template T &chmin(T &a, const T &b) { return a = min(a, b); } template T &chmax(T &a, const T &b) { return a = max(a, b); } const int INF=1e+18; const double EPS=1e-9; const int MOD=1000000007; const int dx[]={1,0,-1,0},dy[]={0,-1,0,1}; signed main(){ int h,m; double t; scanf("%lld %lld UTC%lf",&h,&m,&t); if(t + EPS < 0) t += 24; if(t > (double)(int)(t + EPS)) m += 30; h += (int)(t + EPS) - 9; if(m >= 60){ m -= 60; h++; } while(h < 0) h += 24; while(h >= 24) h -= 24; printf("%02lld:%02lld\n",h,m); return 0; }