#include <bits/stdc++.h>
using namespace std;
bool debug = false;
vector<bool> a;
int n, k;
int minD(int i) {
  int ans = a.size();
  for (int j = 0; j < a.size(); ++j)
    if (a[j]) ans = min(ans, abs(j - i));
  return ans;
}
int queries = 0;
map<pair<int, int>, bool> memo;
bool ask(int x, int y) {
  auto xy = make_pair(x, y);
  if (memo.count(xy)) return memo[xy];
  queries++;
  cout << "1 " << x << " " << y << endl;
  fflush(stdout);
  if (debug) return minD(x - 1) <= minD(y - 1);
  string ans;
  cin >> ans;
  return memo[xy] = (ans == "TAK");
}
int simpleBS(int lo, int hi) {
  for (int mi; lo < hi;) {
    mi = (lo + hi) / 2;
    if (ask(mi, mi + 1))
      hi = mi;
    else
      lo = mi + 1;
  }
  return lo;
}
int check(int i) {
  if (i > 1 && !ask(i, i - 1)) return false;
  if (i < n && !ask(i, i + 1)) return false;
  return true;
}
int main() {
  if (debug) {
    a = vector<bool>{1, 1, 0};
    n = a.size();
    k = count(a.begin(), a.end(), 1);
  } else
    cin >> n >> k;
  int ans1 = simpleBS(1, n);
  if (ans1 < n) {
    int lo = ans1 + 1, hi = n, mi;
    while (lo < hi) {
      mi = (lo + hi) / 2;
      if (ask(mi + 1, mi)) {
        {
          cout << "2 " << (ans1) << " " << (simpleBS(mi + 1, n)) << endl;
          return 0;
        };
      } else
        hi = mi;
    }
    if (lo == n && ask(n, n - 1)) {
      cout << "2 " << (ans1) << " " << (n) << endl;
      return 0;
    };
    if (lo == ans1 + 1 && ask(lo, ans1)) {
      cout << "2 " << (ans1) << " " << (lo) << endl;
      return 0;
    };
  }
  {
    int lo = 1, hi = ans1 - 1, mi;
    while (lo < hi) {
      mi = (lo + hi) / 2;
      if (ask(mi, mi + 1)) {
        {
          cout << "2 " << (ans1) << " " << (simpleBS(lo, mi)) << endl;
          return 0;
        };
      } else
        lo = mi + 1;
    }
    {
      cout << "2 " << (ans1) << " " << (lo) << endl;
      return 0;
    };
  }
  return 0;
}
