import std.stdio; import std.string; import std.conv; import std.algorithm; import std.math; import std.range; void answer(int[] ans){ writefln("! %s", ans.to!(string[]).join(" ")); stdout.flush; } int query(int[] ans){ writefln("? %s", ans.to!(string[]).join(" ")); stdout.flush; return readln.chomp.to!int; } void n6(){ int[][] perm; int[] a = iota(1, 7).array; do{ perm ~= a.dup; }while(a.nextPermutation); int min = 0; int max = cast(int)perm.length - 1; while(min != max){ int c = (min + max + 1) / 2; switch(query(perm[c])){ case 1: min = c; break; case 0: max = c - 1; break; default: return; } } answer(perm[min]); } void main(){ int n = readln.chomp.to!int; if(n == 6){ n6; return; } int[] fixed; int min = 0; int max = n - 1; int[] cand; for(auto i = 1; i <= n; i++){ cand ~= i; } while(fixed.length < n - 1){ int c = (min + max + 1) / 2; auto r = query(fixed ~ cand[c] ~ cand[0 .. c] ~ cand[c + 1 .. $]); switch(r){ case 1: min = c; break; case 0: max = c - 1; break; default: return; } if(min == max){ fixed ~= cand[min]; cand = cand.remove(min); min = 0; max = cast(int)cand.length - 1; } } answer(fixed ~ cand); }