'use strict';
(function(stdin) {
  var inputs = stdin.toString().trim().split('\n');

  (function(S) {
    // ????????????????????????
    console.log(h = S / 60 * 60, m = (S - h * 60) / 60, s = S - (h * 60) - (m * 60))


  })(parseInt(inputs[0], 10)); // ??°?????????

}(require('fs').readFileSync('/dev/stdin', 'utf8')));