#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10, pi = 3.1415926535898;
const int mod = 1e9 + 7, maxn = 2e5 + 10;
int T, n, k, m;
long long x, y, z, a[maxn];
long long get(int x, int y) {
  long long c1, c2;
  printf("and %d %d\n", x, y);
  fflush(stdout);
  scanf("%lld", &c1);
  printf("or %d %d\n", x, y);
  fflush(stdout);
  scanf("%lld", &c2);
  return c1 + c2;
}
int main(int argc, char const *argv[]) {
  scanf("%d %d", &n, &k);
  x = get(1, 2);
  y = get(2, 3);
  z = get(3, 1);
  a[1] = (x + z - y) / 2;
  a[2] = (x + y - z) / 2;
  a[3] = (y + z - x) / 2;
  for (int i = 4; i <= n; ++i) {
    x = get(1, i);
    a[i] = x - a[1];
  }
  sort(a + 1, a + n + 1);
  printf("finish %lld\n", a[k]);
  fflush(stdout);
  return 0;
}
