#include <bits/stdc++.h>
using namespace std;
string s;
bool print(int x, int y) {
  cout << 1 << " " << x << " " << y << endl;
  cin >> s;
  fflush(stdout);
  if (s == "TAK") return true;
  return false;
}
int main() {
#pragma warning(disable : 4996)
  int n, k, a, b;
  scanf("%d%d", &n, &k);
  int l = 1, r = n;
  while (r != l) {
    int m = (l + r) / 2;
    if (print(m, m + 1)) {
      r = m;
    } else
      l = m + 1;
  }
  a = r;
  l = 1, r = a - 1;
  while (r > l) {
    int m = (l + r) / 2;
    if (print(m, m + 1))
      r = m;
    else
      l = m + 1;
  }
  if (r >= l && print(r, a)) {
    cout << 2 << " " << a << " " << r << endl;
    return 0;
  }
  l = a + 1, r = n;
  while (r > l) {
    int m = (l + r) / 2;
    if (print(m, m + 1))
      r = m;
    else
      l = m + 1;
  }
  if (r >= l && print(r, a)) {
    cout << 2 << " " << a << " " << r << endl;
    return 0;
  }
  return 0;
}
