#include #include #include #include #include #include using namespace std; int main(){ int hour,time,n; float num; string str,nstr; cin >> hour >> time >> str; for(int i=4;i<=str.size();i++){ nstr[i-4] = str[i]; } num = stod(nstr); if(str[3]=='-') num*=(-1); num-=9; num*=60; time+=num; while(time<0){ time+=60; hour--; } while(time>=60){ time-=60; hour++; } if(hour<0) hour+=24; else if(hour>=24) hour-=24; if(hour<10) cout << '0' << hour; else cout << hour; cout << ':' ; if(time<10) cout << '0' << time << endl; else cout << time << endl; return 0; }