#include<bits/stdc++.h> using namespace std; int main(){ double a,b,r,f=480; int g=60,h=0,y=0; cin>>a>>b; r=a/b; f=f-(r+10); y=(int)f/g; h=(int)f%g; printf("%02d:%02d",y,h); return 0; }