#include <iostream>
using namespace std;
int main()
{
int s, v,t;
cin >> s >> v;
if (s % v == 0)t = s / v + 10;
else t = s / v + 11;
if(t/60<=8)
{
if (t % 60 == 0)cout << "0"<<8 - (t / 60) << ":00" << endl;
else cout << "0"<<7 - (t / 60) << ":" << 60 - (t % 60) << endl;
}
else
{
if (t % 60 == 0)cout << 32 - (t / 60) << ":00" << endl;
else cout << 31 - (t / 60) << ":" << 60 - (t % 60) << endl;
}
return 0;
}