#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
using namespace std;
int main()
{
int s, v;
cin >> s >> v;
int t = ceil(1.0 * s / v);
if (470 >= t)
{
if ((470 - t) / 60 <= 10) printf("0%d", (470 - t) / 60);
else cout << (470 - t) / 60;
cout << ':';
if ((470 - t) % 60 <= 10) printf("0%d", (470 - t) % 60);
else cout << (470 - t) % 60;
}
else
{
int ti = t - 470;
if ((1440 - ti) / 60 <= 10) printf("0%d", (1440 - ti) / 60);
else cout << (1440 - ti) / 60;
cout << ':';
if ((1440 - ti) % 60 <= 10) printf("0%d", (1440 - ti) % 60);
else cout << (1440 - ti) % 60;
}
return 0;
}