#include <bits/stdc++.h>
using namespace std;
int find_order(int left, int right) {
  string ans;
  if (left <= right) {
    while (left != right) {
      int middle = (left + right - 1) / 2;
      cout << "1 " << middle << " " << middle + 1 << "\n";
      fflush(stdout);
      cin >> ans;
      if (ans == "TAK")
        right = middle;
      else
        left = middle + 1;
    }
    return left;
  } else {
    while (left != right) {
      int middle = (left + right) / 2;
      cout << "1 " << middle + 1 << " " << middle << "\n";
      fflush(stdout);
      cin >> ans;
      if (ans == "TAK")
        right = middle + 1;
      else
        left = middle;
    }
    return left;
  }
}
int main() {
  int n, k;
  cin >> n >> k;
  int left = 1, right = n;
  string ans;
  int order_1 = find_order(left, right);
  int order_2;
  if (order_1 == 1) {
    left = n;
    right = 1;
    order_2 = find_order(left, right);
  } else if (order_1 == n) {
    left = 1;
    right = n;
    order_2 = find_order(left, right);
  } else {
    left = 1;
    right = order_1;
    order_2 = find_order(left, right);
    if (order_2 == order_1) {
      left = n;
      right = order_1;
      order_2 = find_order(left, right);
    }
  }
  cout << "2 " << order_1 << " " << order_2 << "\n";
  fflush(stdout);
  return 0;
}
