#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
long long qp(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a;
    b >>= 1;
    a = a * a;
  }
  return res;
}
const double eps = 1e-8;
const int N = 1e4 + 10, mod = 1e9 + 7;
int ask1(int i, int j) {
  cout << "or" << ' ' << i << ' ' << j << endl;
  int x;
  cin >> x;
  return x;
}
int ask2(int i, int j) {
  cout << "and" << ' ' << i << ' ' << j << endl;
  int x;
  cin >> x;
  return x;
}
int a[N];
void solve() {
  int n, k;
  cin >> n >> k;
  int x, y, z;
  int z1 = ask1(1, 2), z2 = ask2(1, 2);
  x = z1 + z2;
  z1 = ask1(2, 3), z2 = ask2(2, 3);
  y = z1 + z2;
  z1 = ask1(1, 3), z2 = ask2(1, 3);
  z = z1 + z2;
  a[3] = (y + z - x) / 2;
  a[1] = z - a[3];
  a[2] = x - a[1];
  for (int i = 3; i <= n - 1; i++) {
    z1 = ask1(i, i + 1), z2 = ask2(i, i + 1);
    a[i + 1] = z1 + z2 - a[i];
  }
  sort(a + 1, a + 1 + n);
  printf("finish %d\n", a[k]);
}
int main() {
  int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
