#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int lcm(int a, int b) { return a * (b / gcd(a, b)); }
const int sz = 100000 + 10;
bool first = 0;
int solve(int s, int e) {
  int l, r;
  string str;
  while (s < e) {
    l = (s + e) / 2, r = l + 1;
    cout << 1 << " " << l << " " << r << endl;
    fflush(stdout);
    cin >> str;
    if (str[0] == 'T') {
      e = l;
      first = 1;
    } else
      s = r;
  }
  return s;
}
int main() {
  int n, k;
  cin >> n >> k;
  int a[2] = {0}, t;
  a[0] = solve(1, n);
  first = 0;
  t = solve(1, a[0] - 1);
  if (first)
    a[1] = t;
  else
    a[1] = solve(a[0] + 1, n);
  cout << "2 " << a[0] << " " << a[1] << endl;
  fflush(stdout);
  return 0;
}
