let n = stdin.ReadLine () |> int let digits = if n % 36 = 0 then n / 36 - 1 else n / 36 let num = if n % 36 = 0 then 36 else n % 36 let mutable b_head = "" let mutable n_count = num for i = 8 downto 1 do if b_head = "" && n_count - i <= 0 then b_head <- (string (9-i)) + (string (9-i+n_count)) n_count <- n_count - i b_head + String.replicate digits (string b_head.[1]) |> printfn "%s"