#include <stdio.h>
int main()
{
int s,v,t;
scanf("%d %d",&s,&v);
if(s/v< (float)s/v)
t=s/v+1+10;
else
t=s/v+10;
int tmp = t/60;
int tmp1= t%60;
if(tmp1 == 0)
if(tmp/8<=1)
printf("%02d:00",8-tmp);
else
printf("%02d:00",8+24-tmp);
else
if(tmp/8<=1)
printf("%02d:%02d",7-tmp,60-tmp1);
else
printf("%02d:%02d",7+24-tmp,60-tmp1);
return 0;
}