#include <iostream>
#include<iomanip>
#include<cmath>
using namespace std;
int main()
{
int s = 0; int v = 0;
cin >> s >> v;
double time = (double)s / (double)v;
if (time > 1440)
time = 1440.0;
int hh = time / 60;
double mm = time - hh * 60;
int HH = (7 + 24-hh) % 24;
int MM = 60 - 10 - (int)(ceil(mm));
cout <<setw(2)<<setfill('0') << HH << ":" <<setw(2)<< MM;
return 0;
}