// Arup Guha
// 11/8/2025
// Solution to 2025 SER D1/D2 Problem B: Blind Bottles

import java.util.*;

public class blindbottles {

	public static Random r;
	
	public static void main(String[] args) {
	
		r = new Random();
		Scanner stdin = new Scanner(System.in);
		int n = stdin.nextInt();
		
		// canBe[i][j] will be true iff entry i can equal j.
		boolean[][] canBe = new boolean[n][n];
		
		// Stores number of possible entries.
		int[] possible = new int[n];
		Arrays.fill(possible, n);
		for (int i=0; i<n; i++) 
			Arrays.fill(canBe[i], true);
			
		// Just following directions.
		for (int loop=0; loop<10000; loop++) {
		
			// Just do a random permutation.
			int[] rndPerm = getRnd(n);
			StringBuffer sb = new StringBuffer();
			sb.append(rndPerm[0]);
			
			// Print it out.
			for (int i=1; i<n; i++)
				sb.append(" "+rndPerm[i]);
			System.out.println(sb);
			System.out.flush();
			
			// Read their response.
			int correct = stdin.nextInt();
			
			// This is definitive info.
			if (correct == 0) {
			
				// Go to each spot.
				for (int i=0; i<n; i++) {
					
					// Now we know position i can't be rndPerm[i]
					if (canBe[i][rndPerm[i]-1]) {
						possible[i]--;
						canBe[i][rndPerm[i]-1] = false;
					}
				}
				
				// See if we have it.
				boolean weHaveIt = true;
				for (int i=0; i<n; i++)
					if (possible[i] > 1)
						weHaveIt = false;
				
				// Great, output it.
				if (weHaveIt) {
					output(canBe, n);
					break;
				}
			} // end if
			
			// Otherwise we'll WA...
			else if (correct == n)
				break;
			
		} // end loop
	} // end main
	
	// Returns a random permutation of 1 to n.
	public static int[] getRnd(int n) {
		
		// Store answer.
		int[] res = new int[n];
		
		// Store each # 1 to n here.
		int[] tmp = new int[n];
		for (int i=1; i<=n; i++)
			tmp[i-1] = i;
		
		// Randomly select an unselected number and place it...
		for (int i = 0; i<n; i++) {
			int x = r.nextInt(n-i);
			res[i] = tmp[x];
			tmp[x] = tmp[n-1-i];
		}
		
		return res;
		
	}
	
	public static void output(boolean[][] canBe, int n) {
	
		// No space before this one.
		int first = -1;
		for (int j=0; j<n; j++)
			if (canBe[0][j])
				System.out.print(j+1);
				
		// Do the rest.
		for (int i=1; i<n; i++) {
		
			// Output the valid ith value.
			for (int j=0; j<n; j++)
				if (canBe[i][j])
					System.out.print(" "+(j+1));
		
		}
		
		// Finish...
		System.out.println();
		System.out.flush();
	}
}