
val = gets.to_i
ans = {
  hour: 0,
  minute: 0,
  second: 0
}

while true do
  if 3600 < val #????????? 60 * 60
    val -= 3600
    ans[:hour] += 1
  elsif 60 < val #??????
    val -= 60
    ans[:minute] += 1
  else
    ans[:second] = val
    break
  end
end

p "#{ans[:hour]:ans[:minute]:ans[:second]}"