#include <bits/stdc++.h>
using namespace std;
long long max(long long a, long long b) { return (a > b) ? a : b; }
long long min(long long a, long long b) { return (a < b) ? a : b; }
void ain(vector<long long> &a) {
  for (long long i = 0; i < (long long)a.size(); i++) cin >> a[i];
}
long long Ceil(double d) { return ((long long)d == d) ? d : d + 1; }
long long gcd(long long a, long long b) { return (a == 0) ? b : gcd(b % a, a); }
class link_cut_tree {
 public:
  long long n;
  vector<vector<long long> > child;
  vector<long long> par;
  vector<long long> flip;
  vector<long long> self;
  vector<long long> vir, sub;
  vector<long long> path;
  link_cut_tree(long long _n) {
    n = _n;
    child.assign(n + 1, vector<long long>(2, 0));
    par.assign(n + 1, 0);
    flip.assign(n + 1, 0);
    vir.assign(n + 1, 0);
    sub.assign(n + 1, 0);
    self.assign(n + 1, 0);
    path.assign(n + 1, 0);
  }
  void push(long long x) {
    if (!x || !flip[x]) return;
    flip[child[x][0]] ^= 1;
    flip[child[x][1]] ^= 1;
    swap(child[x][0], child[x][1]);
    flip[x] = 0;
  }
  void pull(long long x) {
    if (!x) return;
    push(x);
    push(child[x][0]);
    push(child[x][1]);
    path[x] = path[child[x][0]] + path[child[x][1]] + self[x];
    sub[x] = sub[child[x][0]] + sub[child[x][1]] + self[x] + vir[x];
  }
  bool isRoot(long long x) {
    return !(child[par[x]][0] == x || child[par[x]][1] == x);
  }
  void rotate(long long x) {
    long long y = par[x], z = par[y];
    long long l = (child[y][1] == x), r = l ^ 1;
    if (!isRoot(y)) child[z][child[z][1] == y] = x;
    par[x] = z;
    par[y] = x;
    par[child[x][r]] = y;
    child[y][l] = child[x][r];
    child[x][r] = y;
    pull(y);
    pull(x);
    pull(z);
  }
  void down(long long x) {
    if (!isRoot(x)) down(par[x]);
    push(x);
  }
  void splay(long long x) {
    down(x);
    for (push(x); !isRoot(x); rotate(x)) {
      long long y = par[x], z = par[y];
      if (!isRoot(y)) rotate((child[z][0] == y) ^ (child[y][0] == x) ? x : y);
    }
  }
  long long access(long long x) {
    long long v = 0;
    for (long long u = x; u; v = u, u = par[u]) {
      splay(u);
      vir[u] += sub[child[u][1]];
      vir[u] -= sub[v];
      child[u][1] = v;
      pull(u);
    }
    splay(x);
    return v;
  }
  long long find_root(long long x) {
    access(x);
    while (child[x][0]) x = child[x][0];
    return x;
  }
  void reroot(long long x) {
    access(x);
    flip[x] ^= 1;
    push(x);
  }
  void link(long long u, long long v) {
    reroot(u);
    vir[v] += sub[u];
    par[u] = v;
    pull(v);
  }
  void cut(long long u, long long v) {
    reroot(u);
    access(v);
    child[v][0] = par[u] = 0;
    pull(v);
  }
  long long lca(long long u, long long v) {
    if (u == v) return u;
    access(u);
    long long oth = access(v);
    return par[u] ? oth : 0;
  }
  long long Path(long long u, long long v) {
    reroot(u);
    access(v);
    return path[v];
  }
  long long subtree(long long u, long long v) {
    reroot(v);
    access(u);
    return vir[u] + self[u];
  }
  void update(long long u, long long v) {
    access(u);
    self[u] = v;
    pull(u);
  }
  void updateUtil(long long c, long long v) {
    self[c] = v;
    if (child[c][0]) updateUtil(child[c][0], v);
    if (child[c][1]) updateUtil(child[c][1], v);
    pull(c);
  }
  void update(long long x, long long y, long long v) {
    reroot(x);
    access(y);
    updateUtil(y, v);
  }
};
struct DSU {
  vector<long long> parent;
  vector<long long> size;
  DSU(long long n) {
    parent.assign(n + 1, -1);
    size.assign(n + 1, -1);
    for (long long i = 0; i < n + 1; i++) {
      make_set(i);
    }
  }
  void make_set(long long u) {
    parent[u] = u;
    size[u] = 1;
  }
  long long find_set(long long u) {
    if (parent[u] == u) {
      return u;
    }
    return parent[u] = find_set(parent[u]);
  }
  void union_sets(long long u, long long v) {
    long long leader_u = find_set(u);
    long long leader_v = find_set(v);
    if (leader_u != leader_v) {
      if (size[leader_u] < size[leader_v]) {
        swap(leader_u, leader_v);
      }
      parent[leader_v] = leader_u;
      size[leader_u] += size[leader_v];
    }
  }
};
long long n, k;
vector<long long> arr;
void f(long long i, long long j, long long k, long long ioj, long long iok,
       long long jok, long long iaj, long long iak, long long jak) {
  arr[i] = 0;
  for (long long b = 0; b <= 32; b++) {
    if (((1LL << b) & ioj) == 0 || ((1LL << b) & iok) == 0)
      ;
    else {
      if ((((1LL << b) & iaj) != 0) || (((1LL << b) & iak) != 0)) {
        arr[i] = arr[i] | (1LL << b);
      } else {
        if (((1LL << b) & jok) == 0) {
          arr[i] = arr[i] | (1LL << b);
        }
      }
    }
  }
}
void g(long long i, long long j, long long ioj, long long iaj) {
  arr[j] = 0;
  for (long long b = 0; b <= 32; b++) {
    if ((1LL << b) & arr[i]) {
      if ((1LL << b) & iaj) arr[j] = arr[j] | (1LL << b);
    } else {
      if ((1LL << b) & ioj) arr[j] = arr[j] | (1LL << b);
    }
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> k;
  arr.assign(n, -1);
  for (long long i = 0; i < n; i++) {
    if (arr[i] != -1) continue;
    if (i == 0) {
      long long j = 1, k = 2;
      cout << "or " << i + 1 << ' ' << j + 1 << endl;
      long long ioj;
      cin >> ioj;
      cout << "or " << i + 1 << ' ' << k + 1 << endl;
      long long iok;
      cin >> iok;
      cout << "or " << j + 1 << ' ' << k + 1 << endl;
      long long jok;
      cin >> jok;
      cout << "and " << i + 1 << ' ' << j + 1 << endl;
      long long iaj;
      cin >> iaj;
      cout << "and " << i + 1 << ' ' << k + 1 << endl;
      long long iak;
      cin >> iak;
      cout << "and " << j + 1 << ' ' << k + 1 << endl;
      long long jak;
      cin >> jak;
      f(i, j, k, ioj, iok, jok, iaj, iak, jak);
      f(j, i, k, ioj, jok, iok, iaj, jak, iak);
      f(k, i, j, iok, jok, ioj, iak, jak, iaj);
    } else {
      long long f = 0, s = i;
      cout << "or " << f + 1 << ' ' << s + 1 << endl;
      long long ioj;
      cin >> ioj;
      cout << "and " << f + 1 << ' ' << s + 1 << endl;
      long long iaj;
      cin >> iaj;
      g(f, s, ioj, iaj);
    }
  }
  sort(arr.begin(), arr.end());
  cout << "finish " << arr[k - 1] << endl;
  return 0;
}
