#include <bits/stdc++.h>
using namespace std;
bool check(int a, int b) {
  cout << "1 " << a << " " << b << endl;
  string resp;
  cin >> resp;
  return resp == "TAK";
}
int findOrder(int left, int right, int target) {
  if (left == right) {
    return left;
  } else if (left > right) {
    return target;
  } else if (target >= right) {
    int b = (1 + left + right) / 2;
    int a = b - 1;
    if (check(a, b)) {
      return findOrder(left, a, target);
    } else {
      return findOrder(b, right, target);
    }
  } else {
    int a = (1 + left + right) / 2;
    int b = a - 1;
    if (check(a, b)) {
      return findOrder(a, right, target);
    } else {
      return findOrder(left, b, target);
    }
  }
}
int main() {
  std::ios_base::sync_with_stdio(false);
  int N, K;
  cin >> N >> K;
  int first_point = findOrder(1, N, N);
  int cand_second =
      1 != first_point ? findOrder(1, first_point, first_point) : first_point;
  int second_point =
      cand_second == first_point
          ? findOrder(first_point + 1, N - (N == first_point), first_point)
          : cand_second;
  cout << "2 " << first_point << " " << second_point << endl;
  return 0;
}
