#include <bits/stdc++.h>
using namespace std;
int n;
bool ask(int x, int y) {
  if (x == 0) return false;
  if (y == n + 1) return true;
  cout << "1 " << x << " " << y << endl;
  fflush(stdout);
  string res;
  cin >> res;
  return res == "TAK";
}
void answer(int a, int b) {
  cout << "2 " << a << " " << b << endl;
  fflush(stdout);
}
int getDish(int left, int right) {
  if (right < left) return -1;
  while (right - left > 1) {
    int mid = left + right >> 1;
    if (ask(mid, mid + 1)) {
      right = mid;
    } else {
      left = mid + 1;
    }
  }
  return ask(left, right) ? left : right;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int k;
  cin >> n >> k;
  int a = getDish(0, n + 1);
  int b = getDish(0, a - 1);
  if (!ask(b, a)) {
    b = getDish(a + 1, n + 1);
  }
  answer(b, a);
  return 0;
}
