#include <iostream>
#include <cstdio>
#define ll long long
using namespace std;
int main()
{
ll ms;
scanf("%lld",&ms);
ll ss = ms / 1000;
ll s = ss % 60;
ll m = ss / 60 % 60;
ll h = ss / 60 / 60 % 24;
printf("%02lld:%02lld:%02lld",h,m,s);
return 0;
}