#include <bits/stdc++.h>
using namespace std;
int chk(vector<int> &a, int n, int k) {
  int swap = 0, st = k;
  for (int i = 0; i < n; i++) {
    if (a[i] % 2 == 0) {
      swap += abs(i - st);
      st += 2;
    }
  }
  return swap;
}
int main() {
  std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int t = 1;
  while (t--) {
    long long n, k;
    cin >> n >> k;
    vector<long long> a(n);
    vector<long long> orr(n);
    vector<long long> andd(n);
    for (int i = 1; i < n; i++) {
      cout << "and " << 1 << ' ' << i + 1 << "\n" << flush;
      cin >> andd[i];
      cout << "or " << 1 << ' ' << i + 1 << "\n" << flush;
      cin >> orr[i];
    }
    cout << "and " << 2 << ' ' << 3 << "\n" << flush;
    cin >> andd[0];
    cout << "or " << 2 << ' ' << 3 << "\n" << flush;
    cin >> orr[0];
    for (int i = 0; i < 32; i++) {
      long long x = 1LL << i;
      long long a1 = 0, o1 = 0;
      for (int j = 1; j < n; j++) {
        if ((andd[j] & x) == x) {
          a1++;
        }
        if ((orr[j] & x) == x) {
          o1++;
        }
      }
      if (a1 >= 1 || (o1 == n - 1 and (orr[0] & x) == 0LL)) {
        a[0] |= x;
      }
    }
    for (int j = 1; j < n; j++) {
      for (int i = 0; i < 32; i++) {
        long long x = 1LL << i;
        if ((andd[j] & x) == x) {
          a[j] |= x;
        } else if ((orr[j] & x) == x && (a[0] & x) == 0LL) {
          a[j] |= x;
        }
      }
    }
    sort(a.begin(), a.end());
    cout << "finish " << a[k - 1] << "\n";
  }
  return 0;
}
