let to_string lst = let zero_asc = int_of_char '0' and len = List.length lst in String.init len (fun i -> char_of_int (zero_asc + (List.nth lst i))) let solve n = let rec solve' m result = if m <= 0 then result else let d = m / 7 and r = m mod 7 in solve' d (r :: result) in solve' n [] |> to_string let () = let n = read_line () |> int_of_string in solve n |> print_endline