defmodule Main do def main do _ = IO.gets("") IO.gets("") |> String.trim |> String.split |> Enum.map(&String.to_integer/1) |> Enum.sort(&(&1 >= &2)) |> put_on(0,0) |> out |> IO.puts end def put_on([], left, right) do [left, right] end def put_on([head|tail], left, right) when left >= right do put_on(tail, left, right+head) end def put_on([head|tail], left, right) do put_on(tail, left+head, right) end def out([left, right]) do if left == right, do: "possible", else: "impossible" end end