#include<stdio.h>
int main(void)
{
int s, v,time,sum_time,time_,a=0;
scanf("%d %d", &s, &v);
if (s % v == 0)
{
time = s / v + 10;
}
else
{
time = s / v + 10 + 1;
}
sum_time = 6 * 80 + 24 * 60;
if (sum_time - time >= 24 * 60)
{
time_ = sum_time - time - 24 * 60;
}
else
{
time_ = sum_time - time;
}
while (time_ >= 60)
{
time_ -= 60;
a++;
}
if (a < 10)
{
printf("0%d:%d", a, time_);
}
else
{
printf("%d:%d", a, time_);
}
return 0;
}