description: <image>
  
  This is an interactive task
  
  William has a certain sequence of integers a_1, a_2, ..., a_n in his mind, but due to security concerns, he does not want to reveal it to you completely. William is ready to respond to no more than 2 ⋅ n of the following questions:
  
    * What is the result of a [bitwise AND](https://en.wikipedia.org/wiki/Bitwise_operation#AND) of two items with indices i and j (i ≠ j) 
    * What is the result of a [bitwise OR](https://en.wikipedia.org/wiki/Bitwise_operation#OR) of two items with indices i and j (i ≠ j) 
  
  
  
  You can ask William these questions and you need to find the k-th smallest number of the sequence.
  
  Formally the k-th smallest number is equal to the number at the k-th place in a 1-indexed array sorted in non-decreasing order. For example in array [5, 3, 3, 10, 1] 4th smallest number is equal to 5, and 2nd and 3rd are 3.
  
  Input
  
  It is guaranteed that for each element in a sequence the condition 0 ≤ a_i ≤ 10^9 is satisfied.
  
  Interaction
  
  In the first line you will be given two integers n and k (3 ≤ n ≤ 10^4, 1 ≤ k ≤ n), which are the number of items in the sequence a and the number k.
  
  After that, you can ask no more than 2 ⋅ n questions (not including the "finish" operation).
  
  Each line of your output may be of one of the following types: 
  
    * "or i j" (1 ≤ i, j ≤ n, i ≠ j), where i and j are indices of items for which you want to calculate the bitwise OR. 
    * "and i j" (1 ≤ i, j ≤ n, i ≠ j), where i and j are indices of items for which you want to calculate the bitwise AND. 
    * "finish res", where res is the kth smallest number in the sequence. After outputting this line the program execution must conclude. 
  
  
  
  In response to the first two types of queries, you will get an integer x, the result of the operation for the numbers you have selected.
  
  After outputting a line do not forget to output a new line character and flush the output buffer. Otherwise you will get the "Idleness limit exceeded". To flush the buffer use:
  
    * fflush(stdout) in C++ 
    * System.out.flush() in Java 
    * stdout.flush() in Python 
    * flush(output) in Pascal 
    * for other languages refer to documentation 
  
  
  
  If you perform an incorrect query the response will be -1. After receiving response -1 you must immediately halt your program in order to receive an "Incorrect answer" verdict.
  
  Hacking
  
  To perform a hack you will need to use the following format:
  
  The first line must contain two integers n and k (3 ≤ n ≤ 10^4, 1 ≤ k ≤ n), which are the number of items in the sequence a and the number k.
  
  The second line must contain n integers a_1, a_2, ..., a_n (0 ≤ a_i ≤ 10^9), the sequence a.
  
  Example
  
  Input
  
  
  7 6
  
  2
  
  7
  
  Output
  
  
  and 2 5
  
  or 5 6
  
  finish 5
  
  Note
  
  In the example, the hidden sequence is [1, 6, 4, 2, 3, 5, 4].
  
  Below is the interaction in the example.
  
  Query (contestant's program)| Response (interactor)| Notes  
  ---|---|---  
  and 2 5| 2| a_2=6, a_5=3. Interactor returns bitwise AND of the given numbers.  
  or 5 6| 7| a_5=3, a_6=5. Interactor returns bitwise OR of the given numbers.  
  finish 5| | 5 is the correct answer. Note that you must find the value and not the index of the kth smallest number.
solution: 					/*
  					ID: abdelra29
  LANG: JAVA
  PROG: zerosum
  					*/
  						/*
  						TO LEARN
  				
  						2-euler tour
  					
  						*/
  						/*
  						TO SOLVE 
  						*/
  						/*
  						bit manipulation shit
  						1-Computer Systems: A Programmer's Perspective
  						2-hacker's delight
  						*/
  						/*
  						TO WATCH
  						
  						*/
  						            import java.util.*;
  								    import java.math.*;
  								    import java.io.*; 
  								    import java.util.stream.Collectors;
  
  								       public class A{
  						            static FastScanner scan=new FastScanner();
  									     public static PrintWriter out = new PrintWriter (new BufferedOutputStream(System.out));
  
  static boolean isprime(int x)
  {
  	if(x%2==0)
  		return false;
  	if(x==1)
  		return false;
  	if(x==2||x==3)
  		return true;
  	for(int i=3;i*i<=x;i+=2)
  		if(x%i==0)
  			return false;
  		return true;
  }
  static int hidden[]={0,181,21,53};
  static Pair askand(int x)
  {
  	System.out.println("and "+x+" "+(x-1));
     //int fi=scan.nextInt();
  	int fi=hidden[x]&hidden[x-1];
  	System.out.println("and "+x+" "+(x-2));
  	int sec=hidden[x]&hidden[x-2];
  	//int sec=scan.nextInt();
  	return new Pair(fi,sec);
  }
  static Pair askor(int x)
  {
  	System.out.println("or "+x+" "+(x-1));
  	//int fi=scan.nextInt();
  int fi=hidden[x]|hidden[x-1];
  	System.out.println("or "+x+" "+(x-2));
  	int sec=hidden[x]|hidden[x-2];
  	//int sec=scan.nextInt();
  	return new Pair(fi,sec);
  }
  static int binaryToDecimal(String n)
      {
          String num = n;
          int dec_value = 0;
   
          // Initializing base value to 1,
          // i.e 2^0
          int base = 1;
   
          int len = num.length();
          for (int i = len - 1; i >= 0; i--) {
              if (num.charAt(i) == '1')
                  dec_value += base;
              base = base * 2;
          }
   
          return dec_value;
      }
  		public static void main(String[] args)  throws Exception 
  						      {
  						 /*
  						 very important tips 
  						 1-just fucking think backwards once in your shitty life
  						 2-consider brute forcing and finding some patterns and observations
  						 3-when you're in contest don't get out because you think there is no enough time
  						 4-don't get stuck on one approach 
  						 */
  					//	File file=new File("D:\\input\\out.txt");
  						//	scan=new FastScanner("D:\\input\\xs_and_os_input.txt");
  							//	out = new PrintWriter(new File("D:\\input\\out.txt"));
  								 
  								 							 /*
  								 READING 
  						
  								 3-Introduction to DP with Bitmasking codefoces
  								 4-Bit Manipulation hackerearth
  								 5-read more about mobious and inculsion-exclusion 
  								 */
  								 /*
  									 1- 
  									 */
  									 /*for(int i=3;i<=30;i++)
  									{
  										int sh=(i%3==0)?i/3:i/3+1;
  										System.out.println(i*2+" "+(sh*4));
  									}*/
  									 
  
  								int tt =1;
  								//tt=scan.nextInt();
  								int T=1;
  							 outer:while(tt-->0)
  								    {	
  								   
  								  int n=scan.nextInt(),k=scan.nextInt();
  								 int ans[]=new int[n+1];
  								 System.out.println("and "+1+" "+2);
  								 int and12=scan.nextInt();
  								 //int and12=hidden[1]&hidden[2];
  								 System.out.println("and "+1+" "+3);
  								 int and13=scan.nextInt();
  								// int and13=hidden[1]&hidden[3];
  								 System.out.println("and "+2+" "+3);
  								 int and23=scan.nextInt();
  								//int and23=hidden[2]&hidden[3];
  
  								 System.out.println("or "+1+" "+2);
  								int or12=scan.nextInt();
  								// int or12=hidden[1]|hidden[2];
  								 System.out.println("or "+1+" "+3);
  								 int or13=scan.nextInt();
  								// int or13=hidden[1]|hidden[3];
  								 System.out.println("or "+2+" "+3);
  								 int or23=scan.nextInt();
  								// int or23=hidden[2]|hidden[3];
  								 StringBuilder first=new StringBuilder("");
  								 StringBuilder second=new StringBuilder("");
  								 StringBuilder third=new StringBuilder("");
  								 for(int i=0;i<=29;i++)
  								 {
  								 	first.append(" ");
  								 	second.append(" ");
  								 	third.append(" ");
  								 }
  								 for(int i=0;i<=29;i++)
  								 {
  								 	//0 equals 29
  								 	//all zeros 
  								 	{
  								 		//000
  								 		if((1&(or12>>i))==0&&(1&(or13>>i))==0){
  								 			first.setCharAt(29-i,'0');
  								 			second.setCharAt(29-i,'0');
  								 			third.setCharAt(29-i,'0');
  								 			continue;
  								 		}
  								 	}
  								 	//all ones 
  								 	{
  								 		//111
  								 		if((1&(and12>>i))==1&&(1&(and13>>i))==1){
  								 			first.setCharAt(29-i,'1');
  								 			second.setCharAt(29-i,'1');
  								 			third.setCharAt(29-i,'1');
  								 			continue;
  								 		}
  								 	}
  								 	//2 zeros 1 ones
  								 	{
  								 		//001
  								 		//and12=0 and13=0 and23=0 or12=0 or13=1 or23=1
  								 		if((1&(and12>>i))==0&&(1&(and13>>i))==0&&(1&(and23>>i))==0&&(1&(or12>>i))==0&&(1&(or13>>i))==1&&(1&(or23>>i))==1)
  								 		{
  								 			first.setCharAt(29-i,'0');
  								 			second.setCharAt(29-i,'0');
  								 			third.setCharAt(29-i,'1');
  								 			continue;
  								 		}
  								 		//010
  								 		if((1&(and12>>i))==0&&(1&(and13>>i))==0&&(1&(and23>>i))==0&&(1&(or12>>i))==1&&(1&(or13>>i))==0&&(1&(or23>>i))==1)
  								 		{
  								 			first.setCharAt(29-i,'0');
  								 			second.setCharAt(29-i,'1');
  								 			third.setCharAt(29-i,'0');
  								 			continue;
  								 		}
  								 		//100
  								 		if((1&(and12>>i))==0&&(1&(and13>>i))==0&&(1&(and23>>i))==0&&(1&(or12>>i))==1&&(1&(or13>>i))==1&&(1&(or23>>i))==0)
  								 		{
  								 			first.setCharAt(29-i,'1');
  								 			second.setCharAt(29-i,'0');
  								 			third.setCharAt(29-i,'0');
  								 			continue;
  								 		}
  								 	}
  								 	//1 zeros 2 ones
  								 	{
  								 		//011
  								 		if((1&(and12>>i))==0&&(1&(and13>>i))==0&&(1&(and23>>i))==1&&(1&(or12>>i))==1&&(1&(or13>>i))==1&&(1&(or23>>i))==1)
  								 		{
  								 			first.setCharAt(29-i,'0');
  								 			second.setCharAt(29-i,'1');
  								 			third.setCharAt(29-i,'1');
  								 			continue;
  								 		}
  								 		//101
  								 		if((1&(and12>>i))==0&&(1&(and13>>i))==1&&(1&(and23>>i))==0&&(1&(or12>>i))==1&&(1&(or13>>i))==1&&(1&(or23>>i))==1)
  								 		{
  								 			first.setCharAt(29-i,'1');
  								 			second.setCharAt(29-i,'0');
  								 			third.setCharAt(29-i,'1');
  								 			continue;
  								 		}
  								 		//110
  								 		if((1&(and12>>i))==1&&(1&(and13>>i))==0&&(1&(and23>>i))==0&&(1&(or12>>i))==1&&(1&(or13>>i))==1&&(1&(or23>>i))==1)
  								 		{
  								 			first.setCharAt(29-i,'1');
  								 			second.setCharAt(29-i,'1');
  								 			third.setCharAt(29-i,'0');
  								 			continue;
  								 		}
  								 	}
  								 //	System.out.println("FUCK");
  								 }
  								// out.println(second);
  								 ans[1]=binaryToDecimal(first.toString());
  								 ans[2]=binaryToDecimal(second.toString());
  								 ans[3]=binaryToDecimal(third.toString());
  								// out.println(Arrays.toString(ans));
  								int my=ans[1];
  								 for(int i=4;i<=n;i++)
  								 {
  								 	System.out.println("and "+1+" "+i);
  								 	int and=scan.nextInt();
  								 	System.out.println("or "+1+" "+i);
  								 	int or=scan.nextInt();
  								 	StringBuilder now=new StringBuilder("");
  								 	for(int j=0;j<=29;j++)
  								 		now.append(" ");
  								 	for(int j=0;j<=29;j++)
  								 	{
  								 		if((1&(and>>j))==1)
  								 		{
  								 			now.setCharAt(29-j,'1');
  								 		}
  								 		else if((1&(or>>j))==0)
  								 		{
  								 			now.setCharAt(29-j,'0');
  								 		}
  								 		else {
  								 			if((1&(my>>j))==1)
  								 				now.setCharAt(29-j,'0');
  								 			else now.setCharAt(29-j,'1');
  								 		}
  								 	}
  								 	int ok=binaryToDecimal(now.toString());
  								 	ans[i]=ok;
  								 }
  								 ArrayList<Integer>res=new ArrayList<Integer>();
  								 for(int i=1;i<=n;i++)
  								 	res.add(ans[i]);
  								 Collections.sort(res);
  								System.out.println("finish "+res.get(k-1));
  
  
  
  
  }
  
  		out.close();
  					}
  					
  
  					static class special implements Comparable<special>{
  					int cnt,idx;
  					String s;
  					public special(int cnt,int idx,String s)
  					{
  						this.cnt=cnt;
  						this.idx=idx;
  						this.s=s;
  					}
  
  						 @Override
  								            public int hashCode() {
  								                return (int)42;
  								            }
  						  @Override
  								            public boolean equals(Object o){
  								            //	System.out.println("FUCK");
  								                if (o == this) return true;
  								                if (o.getClass() != getClass()) return false;
  								                special t = (special)o;
  								                return t.cnt == cnt && t.idx == idx;
  								            }
  								            public int compareTo(special o1)
  								            {
  								            	if(o1.cnt==cnt)
  								            	{
  								            		return o1.idx-idx;
  								            	}
  								            	return o1.cnt-cnt;
  								            }
  					}
  		
  								   
  								     static long binexp(long a,long n)
  								    {
  								        if(n==0)
  								            return 1;
  								        long res=binexp(a,n/2);
  								        if(n%2==1)
  								            return res*res*a;
  								        else 
  								            return res*res;
  								    }
  								     
  								    static long powMod(long base, long exp, long mod) {
  								           if (base == 0 || base == 1) return base;
  								           if (exp == 0) return 1;
  								           if (exp == 1) return (base % mod+mod)%mod;
  								           long R = (powMod(base, exp/2, mod) % mod+mod)%mod;
  								           R *= R;
  								           R %= mod;
  								           if ((exp & 1) == 1) {
  								               return (base * R % mod+mod)%mod;
  								           }
  								           else return (R %mod+mod)%mod;
  								       }
  								    static double dis(double x1,double y1,double x2,double y2)
  								    {
  								        return Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
  								    }
  								    static long mod(long x,long y)
  								        {
  								            if(x<0)
  								                x=x+(-x/y+1)*y;
  								            return x%y;
  								        }
  								     public static  long pow(long b, long e) {
  								                long r = 1;
  								                while (e > 0) {
  								                    if (e % 2 == 1) r = r * b ;
  								                    b = b * b;
  								                    e >>= 1;
  								                }
  								                return r;
  								            }
  								    private static void sort(int[] arr) {
  								            List<Integer> list = new ArrayList<>();
  								            for (int object : arr) list.add(object);
  								            Collections.sort(list);
  								        //Collections.reverse(list);
  								            for (int i = 0; i < list.size(); ++i) arr[i] = list.get(i);
  								        }
  								    private static void sort2(long[] arr) {
  								            List<Long> list = new ArrayList<>();
  								            for (Long object : arr) list.add(object);
  								            Collections.sort(list);
  								        Collections.reverse(list);
  								            for (int i = 0; i < list.size(); ++i) arr[i] = list.get(i);
  								        }
  								     static class FastScanner
  						{
  						    private int BS = 1 << 16;
  						    private char NC = (char) 0;
  						    private byte[] buf = new byte[BS];
  						    private int bId = 0, size = 0;
  						    private char c = NC;
  						    private double cnt = 1;
  						    private BufferedInputStream in;
  						 
  						    public FastScanner() {
  						        in = new BufferedInputStream(System.in, BS);
  						    }
  						 
  						    public FastScanner(String s) {
  						        try {
  						            in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
  						        } catch (Exception e) {
  						            in = new BufferedInputStream(System.in, BS);
  						        }
  						    }
  						 
  						    private char getChar() {
  						        while (bId == size) {
  						            try {
  						                size = in.read(buf);
  						            } catch (Exception e) {
  						                return NC;
  						            }
  						            if (size == -1) return NC;
  						            bId = 0;
  						        }
  						        return (char) buf[bId++];
  						    }
  						 
  						    public int nextInt() {
  						        return (int) nextLong();
  						    }
  						 
  						    public int[] nextInts(int N) {
  						        int[] res = new int[N];
  						        for (int i = 0; i < N; i++) {
  						            res[i] = (int) nextLong();
  						        }
  						        return res;
  						    }
  						 
  						    public long[] nextLongs(int N) {
  						        long[] res = new long[N];
  						        for (int i = 0; i < N; i++) {
  						            res[i] = nextLong();
  						        }
  						        return res;
  						    }
  						 
  						    public long nextLong() {
  						        cnt = 1;
  						        boolean neg = false;
  						        if (c == NC) c = getChar();
  						        for (; (c < '0' || c > '9'); c = getChar()) {
  						            if (c == '-') neg = true;
  						        }
  						        long res = 0;
  						        for (; c >= '0' && c <= '9'; c = getChar()) {
  						            res = (res << 3) + (res << 1) + c - '0';
  						            cnt *= 10;
  						        }
  						        return neg ? -res : res;
  						    }
  						 
  						    public double nextDouble() {
  						        double cur = nextLong();
  						        return c != '.' ? cur : cur + nextLong() / cnt;
  						    }
  						 
  						    public double[] nextDoubles(int N) {
  						        double[] res = new double[N];
  						        for (int i = 0; i < N; i++) {
  						            res[i] = nextDouble();
  						        }
  						        return res;
  						    }
  						 
  						    public String next() {
  						        StringBuilder res = new StringBuilder();
  						        while (c <= 32) c = getChar();
  						        while (c > 32) {
  						            res.append(c);
  						            c = getChar();
  						        }
  						        return res.toString();
  						    }
  						 
  						    public String nextLine() {
  						        StringBuilder res = new StringBuilder();
  						        while (c <= 32) c = getChar();
  						        while (c != '\n') {
  						            res.append(c);
  						            c = getChar();
  						        }
  						        return res.toString();
  						    }
  						 
  						    public boolean hasNext() {
  						        if (c > 32) return true;
  						        while (true) {
  						            c = getChar();
  						            if (c == NC) return false;
  						            else if (c > 32) return true;
  						        }
  						    }
  						}
  
  								     static class Pair implements Comparable<Pair>{
  								            public long x, y,z;
  								            public Pair(long x1, long y1,long z1) {
  								                x=x1;
  								                y=y1;
  								                z=z1;
  								            }
  								             public Pair(long x1, long y1) {
  								                x=x1;
  								                y=y1;
  								    
  								            }
  								            
  								            @Override
  								            public int hashCode() {
  								                return (int)(x + 31 * y);
  								            }
  								            public String toString() {
  								                return x + " " + y+" "+z;
  								            }
  								            @Override
  								            public boolean equals(Object o){
  								                if (o == this) return true;
  								                if (o.getClass() != getClass()) return false;
  								                Pair t = (Pair)o;
  								                return t.x == x && t.y == y&&t.z==z;
  								            }
  								    public int compareTo(Pair o)
  								    {
  								    								  	
  								  
  								    	return (int)(x-o.x);
  								     
  								        }
  								     
  								    }
  								}
  								
  								    
  								   
  
  								     
  