//P5707 【深基2.例12】上学迟到
//luogu 2024.7.23
#include <bits/stdc++.h>
using namespace std;
int s, v, t, h = 8, mi, h1, min1;
int main() {
cin >> s >> v;
t = (s / v) + 11;
if (t < 60) {
h--;
cout << setw(2) << setfill('0') << h << ':' << setw(2) << setfill('0') << 60 - t;
} else if (t == 60) {
cout << "07:00";
} else if (t > 60) {
h1 = t / 60;
mi = t % 60;
min1 = 60 - mi;
h = h - h1 - 1;
cout << setw(2) << setfill('0') << h << ':' << setw(2) << setfill('0') << min1;
}
return 0;
}
/*1000 10
6:09*/