#include <cstdio>
#include <iostream>
using namespace std;
typedef long long ll;
int main() {
ll n;
scanf("%lld", &n);
ll total_s = n / 1000; //一共多少秒
ll total_m = total_s / 60; //一共多少分钟
ll total_h = total_m / 60; //一共多少小时
int h = total_h % 24;
int m = total_m % 60;
int s = total_s % 60;
printf("%02d:%02d:%02d", h, m, s);
return 0;
}