#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1.0);
int n, k;
bool go(int val) {
  cout << 1 << " " << val + 1 << " " << val + 2 << endl;
  fflush(stdout);
  string s;
  cin >> s;
  fflush(stdout);
  return s == "TAK";
}
int main(void) {
  ios_base::sync_with_stdio(false);
  cin >> n >> k;
  fflush(stdout);
  int r1 = -1, r2 = -1;
  int bot = 0, top = n - 2;
  while (bot <= top) {
    int mid = (top + bot) / 2;
    if (go(mid)) {
      top = mid - 1;
      r1 = mid;
    } else {
      r1 = mid + 1;
      bot = mid + 1;
    }
  }
  bot = 0;
  top = r1 - 1;
  while (bot <= top) {
    int mid = (top + bot) / 2;
    if (go(mid)) {
      top = mid - 1;
      r2 = mid;
    } else {
      r2 = mid + 1;
      bot = mid + 1;
    }
  }
  if (r1 != r2 and r2 != -1) {
    cout << 2 << " " << r1 + 1 << " " << r2 + 1 << endl;
    fflush(stdout);
    return 0;
  }
  bot = r1 + 1;
  top = n - 2;
  while (bot <= top) {
    int mid = (top + bot + 1) / 2;
    if (go(mid)) {
      top = mid - 1;
      r2 = mid;
    } else {
      r2 = mid + 1;
      bot = mid + 1;
    }
  }
  if (r2 == -1 or r1 == r2) r2 = n - 1;
  cout << 2 << " " << r1 + 1 << " " << r2 + 1 << endl;
  fflush(stdout);
  return 0;
}
