defmodule Main do def input, do: IO.read(:line) |> String.trim def ii, do: input() |> String.to_integer def li, do: input() |> String.split |> Enum.map(&String.to_integer/1) def yn(b), do: (if b, do: "Yes", else: "No") @mod 10 ** 12 def main do n = ii() x = f(1, n, 1) ans = case x do 0 -> String.duplicate("0", 12) _ -> Integer.to_string(x) |> String.slice(-12..-1) end IO.puts ans end def f(x, n, t) do cond do rem(t, @mod) == 0 -> 0 x > n -> t true -> f(x+1, n, x*t) end end end