#include <stdio.h>
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
double s, v;
cin >> s >> v;
double temp;
if (s < v)
{
temp = ceil(s / v) + 10;
}
else
{
temp = s/v + 10;
}
int res = int(temp);
int h;
int m;
if (res >= 60 * 24)
{
return 0;
}
if (res >= 480)
{
res = res - 480;
h = 23 - res / 60;
m = 59 - (res % 60);
}
else if (res < 480)
{
h = 7 - res / 60;
m = 59 - (res % 60);
}
printf("%02d:%02d", h, m);
return 0;
}