#include <bits/stdc++.h>
int main() {
  int n, k;
  std::cin >> n >> k;
  int l = 0, r = n - 1;
  auto req = [&](int x, int y) {
    std::cout << 1 << ' ' << x + 1 << ' ' << y + 1 << '\n';
    std::cout.flush();
    std::string ans;
    std::cin >> ans;
    if (ans == "TAK")
      return 0;
    else if (ans == "NIE")
      return 1;
    return -1;
  };
  int res[2];
  auto bsearch = [&](int l, int r) {
    while (l < r) {
      int d = (r - l);
      int c = (l + r) / 2;
      int c1 = l + d / 4;
      int c2 = r - d / 4;
      if (req(c1, c2) == 0) {
        r = c;
      } else {
        l = c + 1;
      }
    }
    return l;
  };
  res[0] = bsearch(0, n - 1);
  if (res[0] > 0) {
    res[1] = bsearch(0, res[0] - 1);
    if (req(res[1], res[0]) == 1) res[1] = bsearch(res[0] + 1, n - 1);
  } else
    res[1] = bsearch(res[0] + 1, n - 1);
  std::cout << 2 << ' ' << res[0] + 1 << ' ' << res[1] + 1 << '\n';
  std::cout.flush();
}
