import java.io.*;
import java.util.Scanner;
import java.util.StringTokenizer;

/**
Simple error. Wanting to create "basecase" but makes mistakes by editing n, and not the list size.
*/
public class does_not_work_n_below_4 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        in.nextLine();
        if (n < 4){
            n =4;
        }
        boolean[] winningIfYouReach = new boolean[n+1]; // now idx 1 can be nr coins at one.
        winningIfYouReach[1] = true; // Zhivago has to pick this
        winningIfYouReach[2] = false;// Zhivago picks 1
        winningIfYouReach[3] = false;// Zhivago picks 2
        winningIfYouReach[4] = false;// Zhivago picks 3
        for (int i = 5; i < n; i++) {
            winningIfYouReach[i] = !(winningIfYouReach[i-1] || winningIfYouReach[i-2] || winningIfYouReach[i-3]);
        }
        boolean done = false;
        while (!done){
            if(winningIfYouReach[n-1]){
                System.out.println(1);
                System.out.flush();
                n -= 1;
            } else if(winningIfYouReach[n-2]){
                System.out.println(2);
                System.out.flush();
                n -= 2;
            } else {
                System.out.println(3);
                System.out.flush();
                n -= 3;
            }

            String zhivago = in.nextLine();
            if(zhivago.equals("I give up")){
                done = true;
            } else {
                int num = Integer.parseInt(zhivago);
                n -= num;
            }
        }
    }
}


class KattioCoin extends PrintWriter {
    public KattioCoin(InputStream i) {
        super(new BufferedOutputStream(System.out));
        r = new BufferedReader(new InputStreamReader(i));
    }
    public KattioCoin(InputStream i, OutputStream o) {
        super(new BufferedOutputStream(o));
        r = new BufferedReader(new InputStreamReader(i));
    }

    public boolean hasMoreTokens() {
        return peekToken() != null;
    }

    public int getInt() {
        return Integer.parseInt(nextToken());
    }

    public double getDouble() {
        return Double.parseDouble(nextToken());
    }

    public long getLong() {
        return Long.parseLong(nextToken());
    }

    public String getWord() {
        return nextToken();
    }



    private BufferedReader r;
    private String line;
    private StringTokenizer st;
    private String token;

    private String peekToken() {
        if (token == null)
            try {
                while (st == null || !st.hasMoreTokens()) {
                    line = r.readLine();
                    if (line == null) return null;
                    st = new StringTokenizer(line);
                }
                token = st.nextToken();
            } catch (IOException e) { }
        return token;
    }

    private String nextToken() {
        String ans = peekToken();
        token = null;
        return ans;
    }
}
