#include <bits/stdc++.h>
using namespace std;
int n, k;
int query(int l, int r) {
  if (l < 1 || r > n) return false;
  string re;
  cout << 1 << " " << l << " " << r << endl;
  cin >> re;
  return re == "TAK";
}
int get(int l, int r) {
  if (l > r) return false;
  while (l < r) {
    int mid = (l + r) >> 1;
    if (query(mid, mid + 1))
      r = mid;
    else
      l = mid + 1;
  }
  return l;
}
int main() {
  cin >> n >> k;
  int x, y;
  x = get(1, n);
  y = get(1, x - 1);
  if (!query(y, x)) y = get(x + 1, n);
  cout << 2 << " " << x << " " << y << endl;
  return 0;
}
