#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
using namespace std;
double eps = 1e-12;
void _print(long long t) { cerr << t; }
void _print(int t) { cerr << t; }
void _print(string t) { cerr << t; }
void _print(char t) { cerr << t; }
void _print(long double t) { cerr << t; }
void _print(double t) { cerr << t; }
void _print(unsigned long long t) { cerr << t; }
template <class T, class V>
void _print(pair<T, V> p) {
  cerr << "{";
  _print(p.first);
  cerr << ",";
  _print(p.second);
  cerr << "}";
}
template <class T>
void _print(vector<T> v) {
  cerr << "[ ";
  for (T i : v) {
    _print(i);
    cerr << " ";
  }
  cerr << "]";
}
template <class T>
void _print(set<T> v) {
  cerr << "[ ";
  for (T i : v) {
    _print(i);
    cerr << " ";
  }
  cerr << "]";
}
template <class T>
void _print(multiset<T> v) {
  cerr << "[ ";
  for (T i : v) {
    _print(i);
    cerr << " ";
  }
  cerr << "]";
}
template <class T, class V>
void _print(map<T, V> v) {
  cerr << "[ ";
  for (auto i : v) {
    _print(i);
    cerr << " ";
  }
  cerr << "]";
}
template <class T>
void _print(T v[], long long n) {
  cerr << "[ ";
  for (long long i = 0; i < n; i++) {
    _print(v[i]);
    cerr << " ";
  }
  cerr << "]";
}
template <class T>
void _print(T v) {
  cerr << "[ ";
  for (auto i : v) {
    _print(i);
    cerr << " ";
  }
  cerr << "]";
}
void init_code() {}
void solve() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n + 1);
  int tn = n;
  int o1, o2, o3;
  int a1, a2, a3;
  cout << "or"
       << " " << 1 << " " << 2 << endl;
  cin >> o1;
  cout << "and"
       << " " << 1 << " " << 2 << endl;
  cin >> a1;
  cout << "or"
       << " " << 2 << " " << 3 << endl;
  cin >> o2;
  cout << "and"
       << " " << 2 << " " << 3 << endl;
  cin >> a2;
  cout << "or"
       << " " << 1 << " " << 3 << endl;
  cin >> o3;
  cout << "and"
       << " " << 1 << " " << 3 << endl;
  cin >> a3;
  int c1 = o1 + a1;
  int c2 = o2 + a2;
  int c3 = o3 + a3;
  a[1] = (c1 + c3 - c2) / 2;
  a[2] = (c1 - c3 + c2) / 2;
  a[3] = (c2 + c3 - c1) / 2;
  for (int i = 4; i <= n; i++) {
    cout << "or"
         << " " << 1 << " " << i << endl;
    cin >> o1;
    cout << "and"
         << " " << 1 << " " << i << endl;
    cin >> a1;
    int su = o1 + a1;
    a[i] = su - a[1];
  }
  sort((a).begin(), (a).end());
  cout << "finish"
       << " " << a[k] << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
