(function() {
  var isInRange, isNum, reader;

  isNum = function(n) {
    return n.match(/\d{1,5}/);
  };

  isInRange = function(n) {
    return n >= 0 && n <= 86400;
  };

  reader = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout
  });

  reader.on('line', function(line) {
    var a, h, m, s;
    a = isNum(line) ? parseInt(line, 10) : void 0;
    if (isInRange(a)) {
      s = a % 60;
      h = (a - a % 3600) / 3600;
      m = (a - s - h * 3600) / 60;
      return console.log(h + ":" + m + ":" + s);
    }
  });

}).call(this);