#include <bits/stdc++.h>
using namespace std;
long long n, k;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  long long L = 0;
  long long R = n;
  while (R - L > 1) {
    long long M = (L + R) / 2;
    cout << 1 << ' ' << M << ' ' << M + 1 << endl;
    string s;
    cin >> s;
    if (s == "TAK")
      R = M;
    else
      L = M;
  }
  long long l = 0;
  long long r = R;
  while (r - l > 1) {
    long long m = (l + r) / 2;
    cout << 1 << ' ' << m << ' ' << m + 1 << endl;
    string s;
    cin >> s;
    if (s == "TAK")
      r = m;
    else
      l = m;
  }
  if (r != R) {
    cout << 2 << ' ' << r << ' ' << R;
    return 0;
  }
  l = R + 1;
  r = n + 1;
  while (r - l > 1) {
    long long m = (l + r + 1) / 2;
    cout << 1 << ' ' << m << ' ' << m - 1 << endl;
    string s;
    cin >> s;
    if (s == "TAK")
      l = m;
    else
      r = m;
  }
  cout << 2 << ' ' << R << ' ' << l;
}
