#include <iostream>
using namespace std;
int main() {
int s, v,t,n;
int HH, MM;
cin>> s >> v;
if (s % v == 0)
t = s / v;
else
t = s / v + 1;
if (t < 1440) {
if (t < 50)
{
HH = 7;
MM = 50 - t;
}
else {
n = (t - 50) / 60;
HH = 7 - n;
MM = 60 - (t - 50 - n * 60);
}
if (MM > 9) {
cout << 0 << HH << ':' << MM;
}
else {
cout << 0 << HH << ':' << 0 << MM;
}
}
return 0;
}