#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
const double eps = 1e-9;
int check(int f, int t) {
  if (f > t) return -1;
  if (t - f == 0) return f;
  if (t - f <= 3) {
    int best = f;
    for (int i = (f + 1); i < (t + 1); i++) {
      cout << 1 << " " << best << " " << i << endl << flush;
      fflush(stdout);
      string res;
      cin >> res;
      if (res == "NIE") {
        best = i;
      }
    }
    return best;
  }
  int n = t - f + 1;
  int x = (n + 1) / 4;
  cout << 1 << " " << f + x << " " << t - x << endl << flush;
  fflush(stdout);
  string res;
  cin >> res;
  if (res == "TAK") {
    return check(f, f + 2 * x);
  } else {
    return check(t - 2 * x, t);
  }
}
int main() {
  int N, K;
  cin >> N >> K;
  int f = 1, t = N;
  while (f != t) {
    int m = f + (t - f) / 2;
    cout << 1 << " " << m << " " << m + 1 << endl << flush;
    fflush(stdout);
    string res;
    cin >> res;
    if (res == "TAK") {
      t = m;
    } else {
      f = m + 1;
    }
  }
  int id1 = f;
  int id2a = check(1, f - 1);
  int id2b = check(f + 1, N);
  int id2 = -1;
  if (id2a == -1)
    id2 = id2b;
  else if (id2b == -1)
    id2 = id2a;
  else {
    cout << 1 << " " << id2a << " " << id2b << endl << flush;
    fflush(stdout);
    string res;
    cin >> res;
    if (res == "TAK") {
      id2 = id2a;
    } else {
      id2 = id2b;
    }
  }
  cout << 2 << " " << id1 << " " << id2 << endl << flush;
  fflush(stdout);
  return 0;
}
