#include<bits/stdc++.h>
using namespace std;
int main(){
int s,v;
cin >> s >> v;
int t = s / v + 10;
int h = (60 * 32 - t) / 60,m = (60 * 32 - t) % 60 - 1;
if(h > 24) h -= 24;
if(h > 10 && m > 10) cout << h << ':' << m << endl;
else if(h < 10 && m > 10) cout << '0' << h << ':' << m << endl;
else if(h > 10 && m < 10) cout << h << ':' << '0' << m << endl;
else cout << '0' << h << '0' << m << endl;
return 0;
}