#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
void solve() {
  int n, k;
  cin >> n >> k;
  int or12, and12, or23, and23, xor12, xor23, and13, or13, xor13;
  long long summ12, summ13, summ23;
  vector<int> a(n);
  cout << "or " << 1 << " " << 2 << endl;
  cin >> or12;
  cout << "and " << 1 << " " << 2 << endl;
  cin >> and12;
  xor12 = and12 ^ or12;
  summ12 = xor12 + 2 * (and12);
  cout << "or " << 1 << " " << 3 << endl;
  cin >> or13;
  cout << "and " << 1 << " " << 3 << endl;
  cin >> and13;
  xor13 = and13 ^ or13;
  summ13 = xor13 + 2 * (and13);
  cout << "or " << 2 << " " << 3 << endl;
  cin >> or23;
  cout << "and " << 2 << " " << 3 << endl;
  cin >> and23;
  xor23 = and23 ^ or23;
  summ23 = xor23 + 2 * (and23);
  long long first = (summ12 + summ13 + summ23) / 2 - summ23;
  a[0] = first;
  a[1] = summ12 - first;
  a[2] = summ13 - first;
  for (int i = 0; i < n - 3; i++) {
    long long f, s;
    cout << "or " << 1 << " " << i + 4 << endl;
    cin >> f;
    cout << "and " << 1 << " " << i + 4 << endl;
    cin >> s;
    a[i + 3] = a[0] ^ (f ^ s);
  }
  sort(a.begin(), a.end());
  cout << "finish " << a[k - 1] << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int test = 1;
  while (test-- > 0) {
    solve();
  }
}
