#include <bits/stdc++.h>
using namespace std;
int cond = 0, multi = 0, gcj = 0;
int N, K;
void getNK() { cin >> N >> K; }
function<bool(int, int)> ask = [](int x, int y) {
  cout << "1"
       << " " << x << " " << y << endl;
  cout.flush();
  string res;
  cin >> res;
  return res == "TAK";
};
int doit(int le, int ri) {
  while (le < ri) {
    int mid = (le + ri) / 2;
    if (ask(mid, mid + 1)) {
      ri = mid;
    } else
      le = mid + 1;
  }
  return le;
}
struct solver {
  void solve() {
    getNK();
    int le = 1, ri = N;
    while (le < ri) {
      int mid = (le + ri) / 2;
      if (ask(mid, mid + 1)) {
        ri = mid;
      } else
        le = mid + 1;
    }
    if (le > 1) {
      if (ask(le - 1, le) && ask(le, le - 1)) {
        cout << 2 << " " << le - 1 << " " << le << endl;
        return;
      }
    }
    if (le < N) {
      if (ask(le + 1, le) && ask(le, le + 1)) {
        cout << 2 << " " << le << " " << le + 1 << endl;
        return;
      }
    }
    for (int od = 1;; od *= 2) {
      int q1 = min(N, le + od);
      int q2 = min(N, le + 3 * od);
      if (q1 == q2) break;
      if (ask(q2, q1)) {
        int xx = doit(q1, N);
        cout << 2 << " " << le << " " << xx << endl;
        return;
      }
    }
    for (int od = 1;; od *= 2) {
      int q1 = max(1, le - od);
      int q2 = max(1, le - 3 * od);
      if (q1 == q2) break;
      if (ask(q2, q1)) {
        int xx = doit(1, q1);
        cout << 2 << " " << le << " " << xx << endl;
        return;
      }
    }
    {
      if (cond > 0) {
        cerr << 108 << " "
             << "\"\""
             << " "
             << "" << endl;
        cerr.flush();
      }
    };
  }
};
int main(int argc, char** argv) {
  ios::sync_with_stdio(false);
  cond = argc >= 2 && argv[1][0] == 'q' ? 1 << 30 : 0;
  cout.setf(ios::fixed);
  cout.precision(10);
  int t;
  if (multi || gcj)
    cin >> t;
  else
    t = 1;
  for (auto i = (1); i <= (t); ++i) {
    if (cond) cerr << 122 << " " << i << endl;
    if (gcj) cout << "Case #" << i << ": ";
    solver s;
    s.solve();
  }
  return 0;
}
