#include <iostream>
#include <cmath>
using namespace std;
int main (){
int s,u;
cin >> s >> u;
int sj = (24*60+8*60)-(ceil((double)s/u))-10;
int xs = sj / 60;
int fz = sj % 60;
if(xs >= 24){
xs = xs - 24;
}
if((xs < 10) && (fz < 10)){
cout << 0 << xs << ":" << 0 << fz;
}else if((xs < 10) && !(fz < 10)){
cout << 0 << xs << ":" << fz;
}else if(!(xs < 10) && (fz < 10)){
cout << xs << ":" << 0 << fz;
}
return 0;
}