/*
TASK: crossing
LANG: C++
*/
#include <iostream>
#include <cmath>
using namespace std;

double w,s,a,b;

int main()
{
    cin>>w>>s>>a>>b;
    double res = w/a + s/b;
    cout<<int(floor(res))<<":"<<int(res*60)%60<<":"<<int(res*3600)%60<<'\n';
    return 0;
}
