#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {
int s,v;
cin>>s>>v;
int res;
if(s==0){
cout<<"07:50"<<endl;
return 0;
}
if(s%v==0)res=s/v;
else res=s/v+1;
int max=1430;
max-=res;
int hour=max/60;
int min=max%60;
hour+=8;
if(hour<10||hour>24){
if(hour>24)hour-=24;
if(min<10)cout<<0<<hour<<":"<<0<<min<<endl;
else cout<<0<<hour<<":"<<min<<endl;
}
else if(min<10)cout<<hour<<":"<<0<<min<<endl;
else cout<<hour<<":"<<min<<endl;
return 0;
}