#include <bits/stdc++.h>
using namespace std;
int n, k;
int bin(int l, int r) {
  if (l == r) return l;
  int m = (l + r) / 2;
  cout << "1 " << m << " " << m + 1 << endl;
  string s;
  cin >> s;
  if (s == "TAK")
    return bin(l, m);
  else
    return bin(m + 1, r);
}
int main() {
  srand(time(NULL));
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  int x = bin(1, n);
  int y, z;
  if (x != 1) y = bin(1, x - 1);
  if (x != n) z = bin(x + 1, n);
  if (x == 1)
    cout << "2 " << x << " " << z << endl;
  else if (x == n) {
    cout << "2 " << x << " " << y << endl;
  } else {
    cout << "1 " << y << " " << z << endl;
    string s;
    cin >> s;
    if (s == "TAK")
      cout << "2 " << x << " " << y << endl;
    else
      cout << "2 " << x << " " << z << endl;
  }
  return 0;
}
