#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, k;
int binary(int lo, int hi) {
  while (lo < hi) {
    int mi = (lo + hi) / 2;
    cout << 1 << ' ' << mi << ' ' << mi + 1 << endl;
    string s;
    cin >> s;
    if (s == "TAK")
      hi = mi;
    else
      lo = mi + 1;
  }
  return hi;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k;
  int a = binary(1, n), b;
  if (a > 1) {
    b = binary(1, a - 1);
    cout << 1 << ' ' << b << ' ' << a << endl;
    string s;
    cin >> s;
    if (s == "TAK") {
      cout << 2 << ' ' << a << ' ' << b;
      return 0;
    }
  }
  b = binary(a + 1, n);
  cout << 2 << ' ' << a << ' ' << b;
  return 0;
}
