#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 7;
const long long MOD = 998244353;
const long long inf = INF * INF;
const long long mod = MOD;
const long long MAX = 1000010;
const long double PI = acos(-1.0);
signed main() {
  long long n, k;
  cin >> n >> k;
  vector<long long> a(n), b(n);
  for (long long i = (0); i < (n - 1); i++) {
    cout << "and " << 1 << ' ' << i + 2 << '\n';
    cin >> a[i + 1];
    cout << "or " << 1 << ' ' << i + 2 << '\n';
    cin >> b[i + 1];
  }
  long long d;
  cout << "and 2 3" << '\n';
  cin >> d;
  vector<long long> c(n);
  long long an = a[1], o = b[1];
  for (long long i = (1); i < (n); i++) {
    an |= a[i];
    o &= b[i];
  }
  for (long long j = (0); j < (32); j++) {
    if ((1 << j) & o) {
      if ((an & (1 << j)))
        c[0] += (1 << j);
      else if (((1 << j) & d) == 0)
        c[0] += (1 << j);
    }
  }
  for (long long i = (1); i < (n); i++) {
    c[i] = (b[i] - a[i]) ^ c[0];
  }
  sort(c.begin(), c.end());
  cout << "finish " << c[k - 1] << '\n';
}
