#include <iostream>
int main()
{
int s, v, t;
std::cin >> s >> v;
if (s / v == 0)
t = s / v + 10;
else
t = s / v + 1 + 10;
int t_h, t_m;
if (t >= 60)
{
t_h = t / 60;
t_m = t - t_h * 60;
}
else
{
t_h = 0;
t_m = t;
}
if (t_h < 7)
{
t_h = 8 - t_h - 1;
t_m = 60 - t_m;
if (t_m >= 10)
std::cout << "0" << t_h << ":" << t_m;
else
std::cout << "0" << t_h << ":" << "0" << t_m;
return 0;
}
else if (t_h == 7)
{
t_m = 60 - t_m;
if (t_m >= 10)
std::cout << "00" << ":" << t_m;
else
std::cout << "00" << ":" << "0" << t_m;
return 0;
}
else
{
t_h = 24 + 8 - t_h - 1;
t_m = 60 - t_m;
if (t_h >= 10)
{
if (t_m >= 10)
std::cout << t_h << ":" << t_m;
else
std::cout << t_h << ":" << "0" << t_m;
}
else
{
if (t_m >= 10)
std::cout << "0" << t_h << ":" << t_m;
else
std::cout << "0" << t_h << ":" << "0" << t_m;
}
return 0;
}
}