c++
#include<bits/stdc++.h>
using namespace std;
int main(){
int h,m,s,t;
while(cin>>h>>m>>s>>t){
m=h*60+m+90 *t;
h=(m+2160)%2160/60;
m=(m+2160)%2160%60;
cout<<h<<':'<<setw(2)<<setfill('0')<<m<<':'<<setw(2)<<setfill('0')<<s<<endl;
}
}