using namespace std;
int main( )
{
double s,v,t,hour=0;
cin>>s>>v;
t=s/v+10;
for(int i=t;i>60;i=i-60)
{
hour++;
}
if((int)t!=t&&t>=0&&t<=1440)
{
if(hour<8)
{
cout<<"0"<<7-hour<<":"<<60-(int)t%60-1<<endl;
}
else
{
if(hour>=8&&hour<22)
{
cout<<24-hour+8<<":"<<60-(int)t%60-1<<endl;
}
else
{
cout<<"0"<<24-hour+8<<":"<<60-(int)t%60-1<<endl;
}
}
}
else if(t>=0&&t<=1440)
{
if(hour<8)
{
cout<<"0"<<7-hour<<":"<<60-(int)t%60<<endl;
}
else
{
if(hour>=8&&hour<22)
{
cout<<24-hour+8<<":"<<60-(int)t%60<<endl;
}
else
{
cout<<"0"<<24-hour+8<<":"<<60-(int)t%60<<endl;
}
}
}
}