defmodule Main do def main do IO.read(:line) |> String.trim() |> String.to_integer() |> interact() |> IO.puts() end def interact(n) do interact_rec(1..n |> Enum.to_list()) end def interact_rec(r) do r |> Enum.filter(fn x -> i = x - 1 s = r |> List.delete_at(i) IO.gets("? #{(s |> length) - 1}\n#{s |> Enum.join(" ")}\n") |> String.trim() == "0" end) |> (&("! #{&1 |> length}\n#{&1 |> Enum.join(" ")}\n")).() end end