#include<stdio.h>
#include<math.h>
int main() {
int s, v, t, m, h;
scanf("%d %d", &s, &v);
if (s / v == 0) {
t = s / v;
}
else {
t = s / v + 1;
}
t += 10;
h = (8 * 60 - t) / 60;
if(h > 0) {
m = (8 * 60 - t) % 60;
}
else if (h <= 0) {
h = 24 + h;
m = -(8 * 60 - t) % 60;
}
printf("%02d:%02d", h, m);
return 0;
}