#include<iostream>
#include<iomanip>
#include<iomanip>
using namespace std;
int main()
{
int s, v, a ;
float t;
cin >> s >> v;
a = 7;
if(s%v==0)t = (float)s / v + 10;
else t = (float)s / v + 11;
if (t < 480)
{
for (int i = 1;; i++, t -= 60, a--)
if (t <= 60)
{
cout << setfill('0')
<< setw(2) << a << ":" << setprecision(0) << fixed << 60 - t << endl; break;
}
}
}
else
{
t -= 480;
for (int b = 23;; t -= 60, b--)
{
if (t <= 60) {
cout << setfill('0')
<< setw(2) << b << ":" << setprecision(0) << fixed << 60 - t << endl; break;
}
}
}
return 0;
}