#include <bits/stdc++.h>
using namespace std;
int n, k, x, y;
bool ok;
bool query(int a, int b) {
  string str;
  cout << 1 << ' ' << a << ' ' << b << endl;
  fflush(stdout);
  cin >> str;
  return str[0] == 'T';
}
int solve_for(int l, int r) {
  while (l < r) {
    int m = (l + r) >> 1;
    if (query(m, m + 1))
      r = m, ok = true;
    else
      l = m + 1;
  }
  return l;
}
int main() {
  cin >> n >> k;
  x = solve_for(1, n);
  ok = false;
  y = solve_for(1, x - 1);
  if (!ok) y = solve_for(x + 1, n);
  cout << 2 << ' ' << x << ' ' << y << endl;
  fflush(stdout);
  return 0;
}
