#include <bits/stdc++.h>
using namespace std;
long double pi = 4 * atanl(1.0);
string stringmin = "!";
string stringmax = "~";
thread_local int num1234567 = 0;
double ang1 = pi / 180;
int findleft(int n, int num) {
  if (num == 0) return -1;
  int l = 0, r = num - 1;
  while (l != r) {
    cout << "1 " << 1 + (l + r) / 2 << ' ' << 1 + (l + r) / 2 + 1 << endl;
    string ans;
    cin >> ans;
    if (ans == "TAK") {
      r = (l + r) / 2;
    } else {
      l = (l + r) / 2 + 1;
    }
  }
  int idx = l;
  if (idx != num - 1) return idx;
  cout << "1 " << 1 + idx << ' ' << 1 + idx + 1 << endl;
  string ans;
  cin >> ans;
  if (ans == "TAK") {
    return idx;
  } else {
    return -1;
  }
}
int findright(int n, int num) {
  if (num == n - 1) return -1;
  int l = num + 1, r = n - 1;
  while (l != r) {
    cout << "1 " << 1 + (l + r) / 2 + 1 << ' ' << 1 + (l + r) / 2 << endl;
    string ans;
    cin >> ans;
    if (ans == "TAK") {
      l = (l + r) / 2 + 1;
    } else {
      r = (l + r) / 2;
    }
  }
  int idx = l;
  return idx;
}
int main() {
  int n, m;
  cin >> n >> m;
  int l = 0, r = n - 1;
  while (l != r) {
    cout << "1 " << 1 + (l + r) / 2 << ' ' << 1 + (l + r) / 2 + 1 << endl;
    string ans;
    cin >> ans;
    if (ans == "TAK") {
      r = (l + r) / 2;
    } else {
      l = (l + r) / 2 + 1;
    }
  }
  int idx1 = l;
  int idx2 = findleft(n, idx1);
  if (idx2 != -1) {
    cout << "2 " << 1 + idx1 << ' ' << 1 + idx2 << endl;
    return 0;
  }
  int idx3 = findright(n, idx1);
  if (idx3 != -1) cout << "2 " << 1 + idx1 << ' ' << 1 + idx3 << endl;
  return 0;
}
