#include<iostream>
using namespace std;

int main(){
  int h = 0, m = 0, s = 0;
  cin >> s;
  h = (s >= 3600) ? (s / (60 * 60)) : 0;
  h = (s >= 60) ? (s - (s % 3600)) : 0;
  s = (s % 60);
  cout << h << "," << m << "," << s << endl;
  return 0;
}

