#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int m,h;
cin>>m;
poc: cin>>h;
if(h<0||h>24)goto poc;
if(m<60)
cout<<setfill(‘0’) << setw(2)<<h-1<<„:“<<setfill(‘0’) << setw(2) << 60-m;
else
if(m%60==0)
cout<<setfill(‘0’) << setw(2)<<(h-m/60)<<„:“<< setfill(‘0’) << setw(2)<<m%60;
else
cout<<setfill(‘0’) << setw(2)<<(h-1)-m/60<<„:“<<setfill(‘0’) << setw(2)<<60-m%60;
return 0;
}