function Main(input) {
    input = input.split("\n");
    for (i=0; i < input.length-1; i++) {
        var S = parseInt(input[i], 10)
        var h = Math.floor(S / 60 /60)
        var m = Math.floor(S / 60 % 60)
        var s = Math.floor(S % 60)
        var hh = String(h)
        var mm = String(m)
        var ss = String(s)
        var c = ":"
        console.log('%s', hh + ":" + mm + ":" + ss);
    }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
