#include<iostream>
#include
using namespace std;
int main()
{
double s,v;int t=0,h,m;
cin>>s>>v;
t=ceil(s/v);
t+=10;
h=t/60;
m=t%60;
if(t<=480&&m!=0)
{
cout<<"0"<<8-h-1<<":"<<60-m;
}
else if(t<=480&&m==0)
{
cout<<"0"<<8-h<<":"<<"0"<<"0";
}
else if(t>=480&&m!=0)
{
cout<<23-(h-8)<<":"<<60-m;
}
else if(t>480&&m==0)
{
cout<<24-(h-8)<<":"<<"00";
}
return 0;
}