open Str

let rec splitSixty list a =
  match (a / 60, a mod 60) with
  | (syou, amari) ->
    if syou < 60 then syou :: amari :: list
    else splitSixty (amari :: list) syou

let rec fill list = if List.length list >= 3 then list
  else fill (0 :: list)

let rec format list = 
  match list with
  | hour :: minute :: second :: [] -> hour ^ ":" ^ minute ^ ":" ^ second
  | _ -> failwith "Error";;

read_line()
|> int_of_string
|> splitSixty []
|> fill 
|> List.map string_of_int
|> format
|> print_endline

