#include<stdio.h>
int main(void)
{
int late, hh, mm;
float s, v, t;
float school = 480.0;
scanf("%f%f", &s, &v);
t = s / v;
late = (int)(school - (10+t));
if (late < 0)
late += 24 * 60;
hh = late / 60;
mm = late % 60;
if (hh < 10)
{
if (mm < 10)
printf("0%d:0%d", hh, mm);
else
printf("0%d:%d", hh, mm);
}
else
{
if (mm < 10)
printf("%d:0%d", hh, mm);
else
printf("%d:%d", hh, mm);
}
return 0;
}