#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using cd = complex<ld>;
vector<int> init;
int ask(const string &s, int i, int j) {
  cout << s << " " << ++i << " " << ++j << endl;
  cin >> i;
  return i;
}
vector<int> solve(int n, int k) {
  vector<int> a(n - 1), o(n - 1);
  vector<int> res(n);
  for (int i = 0; i + 1 < n; i++) {
    a[i] = ask("and", i, i + 1);
    o[i] = ask("or", i, i + 1);
  }
  int a02 = ask("and", 0, 2);
  for (int bit = 0; bit < 30; bit++) {
    int pi = -1;
    for (int i = 0; i + 1 < n; i++) {
      if ((a[i] >> bit & 1) == (o[i] >> bit & 1)) {
        res[i] |= (a[i] & (1 << bit));
        res[i + 1] |= (a[i] & (1 << bit));
        pi = i;
        break;
      }
    }
    if (pi != -1) {
      for (int i = pi - 1; i >= 0; i--) {
        int pbit = res[i + 1] >> bit & 1;
        for (int c = 0; c <= 1; c++) {
          if ((pbit & c) == (a[i] >> bit & 1) &&
              (pbit | c) == (o[i] >> bit & 1)) {
            res[i] |= c << bit;
          }
        }
      }
      for (int i = pi + 1; i < n; i++) {
        int a1 = a[i - 1] >> bit & 1;
        int o1 = o[i - 1] >> bit & 1;
        int pbit = res[i - 1] >> bit & 1;
        for (int c = 0; c <= 1; c++) {
          if ((pbit & c) == a1 && (pbit | c) == o1) {
            res[i] |= c << bit;
          }
        }
      }
      continue;
    }
    if (a02 >> bit & 1) {
      res[0] |= 1 << bit;
    } else {
      res[1] |= 1 << bit;
    }
    for (int i = 2; i < n; i++) {
      int a1 = a[i - 1] >> bit & 1;
      int o1 = o[i - 1] >> bit & 1;
      int pbit = res[i - 1] >> bit & 1;
      for (int c = 0; c <= 1; c++) {
        if ((pbit & c) == a1 && (pbit | c) == o1) {
          res[i] |= c << bit;
        }
      }
    }
  }
  sort(res.begin(), res.end());
  return res;
}
void stress() {
  while (true) {
    int n = rand() % 100 + 3;
    init.resize(n);
    for (int i = 0; i < n; i++) {
      init[i] = rand() % 400;
    }
    sort(init.begin(), init.end());
    auto res = solve(n, 0);
    if (init != res) {
      cout << n << " 1\n";
      for (int i : init) {
        cout << i << " ";
      }
      cout << endl;
      for (int i : res) {
        cout << i << " ";
      }
      cout << endl;
      exit(0);
    }
    cout << "OK" << endl;
  }
}
void runSolve() {
  int n, k;
  cin >> n >> k;
  auto res = solve(n, k);
  cout << "finish " << res[k - 1] << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  runSolve();
  return 0;
}
