import java.io.*; import java.lang.reflect.Array; import java.math.BigInteger; import java.util.*; import java.util.StringTokenizer; import java.util.function.BiFunction; import java.util.function.BinaryOperator; import java.util.function.ToIntBiFunction; public class Mark { /* Look at the first bottle, then try all swapping and swapping back with all bottles to the right of it. We'll see 2 changes to our score. Swap the two other bottles that changed our score. Now exactly one of these two bottles will increase our score by 2 when swapping with the first bottle. Find which one it is, and make that swap. Now the first bottle and that bottle are correctly placed. Now, repeat with the second bottle, etc... */ public static void main(String[] args) throws IOException { FastReader fr = new FastReader(); PrintWriter pw = new PrintWriter(System.out); int N = fr.nextInt(); boolean[] good = new boolean[N]; int[] guess = new int[N]; for (int i = 0; i < N; ++i) guess[i] = i+1; outer: for (int i = 0; i < N; ++i) { if (good[i]) continue; int curScore = makeGuess(guess, pw, fr); int a = -1, b = -1; for (int j = i+1; j < N; ++j) { if (good[j]) continue; swap(guess, i, j); int score2 = makeGuess(guess, pw, fr); int diff = score2 - curScore; if (diff == 2) { // swapping will put both bottles correctly in place good[i] = true; good[j] = true; continue outer; } swap(guess, i, j); if (diff == -2) { // this bottle is already correctly placed good[i] = true; good[j] = true; continue outer; } if (diff == 1) { if (a == -1) a = j; else if (b == -1) b = j; else assert false; } } if (a == -1) // already correctly placed good[i] = true; else { assert b != -1; swap(guess, a, b); swap(guess, i, a); if (curScore == makeGuess(guess, pw, fr)) { swap(guess, i, a); swap(guess, i, b); good[i] = true; good[b] = true; } else { good[i] = true; good[a] = true; } } } pw.close(); } static int makeGuess(int[] guess, PrintWriter pw, FastReader fr) { for (int j : guess) pw.print(j + " "); pw.println(); pw.flush(); int o = fr.nextInt(); if (o == guess.length) { pw.close(); System.exit(0); } return o; } static void swap(int[] guess, int i, int j) { int temp = guess[i]; guess[i] = guess[j]; guess[j] = temp; } static void shuffle(int[] guess) { List sh = new ArrayList<>(); for (int x : guess) sh.add(x); Collections.shuffle(sh); for (int i = 0; i < guess.length; ++i) guess[i] = sh.get(i); } static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextLine() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } st = null; return str; } } }