#include<bits/stdc++.h>
using namespace std;
int main()
{
int s,v,t;
cin>>s>>v;
if(s%v!=0) t = (s/v)+1;
else t = s/v;
t+=10;
int h=0,m=0;
if(t>=60)
{
h = t/60;
m = t%60;
}
else
{
m = t;
}
if(h>=8||(h==7&&m>0))
{
h-=8;
h=24-h;
}
else h=8-h;
if(m>0)
{
h--;
m=60-m;
}
printf("%02d:%02d",h,m);
return 0;
}