defmodule Main do @mask 1_000_000_000_000 def main do IO.read(:line) |> String.trim() |> String.to_integer() |> solve |> IO.puts() end def solve(n) do cond do n < 40 -> solve_rec(n, 1) true -> "000000000000" end end def solve_rec(1, r) do r end def solve_rec(n, r) do tmp = n * r solve_rec(n - 1, tmp - (tmp |> div(@mask)) * @mask) end end