#include <bits/stdc++.h>
using namespace std;
map<pair<int, int>, bool> was;
bool TAK(int a, int b) {
  if (auto it{was.find({a, b})}; it != was.end()) return it->second;
  cout << "1 " << a << ' ' << b << endl;
  static string s;
  cin >> s;
  return was[{a, b}] = 'T' == s[0];
}
[[noreturn]] void OK(int a, int b) {
  cout << "2 " << a << ' ' << b << endl;
  exit(0);
}
void bs(int& l, int& r, bool go_right = false) {
  while (l + 2 < r) {
    int mid{(l + r) / 2};
    if (go_right) {
      if (TAK(mid + 1, mid))
        l = mid;
      else
        r = mid + 1;
      continue;
    }
    if (TAK(mid, mid + 1))
      r = mid;
    else
      l = mid + 1;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  int l{1}, r{n};
  bs(l, r);
  int ans1;
  if (l + 1 == r) {
    if (TAK(l, l + 1))
      ans1 = l;
    else
      ans1 = l + 1;
  } else {
    if (TAK(l, l + 1)) {
      if (TAK(l, l + 2))
        ans1 = l;
      else
        ans1 = l + 2;
    } else if (TAK(l + 1, l + 2))
      ans1 = l + 1;
    else
      ans1 = l + 2;
  }
  if (ans1 > 1) {
    if (TAK(ans1 - 1, ans1)) OK(ans1 - 1, ans1);
  }
  if (ans1 < n) {
    if (TAK(ans1 + 1, ans1)) OK(ans1, ans1 + 1);
  }
  if (ans1 > 1) {
    l = 1;
    r = ans1 - 1;
    bs(l, r);
    for (int i{l}; i <= r; ++i) {
      if (TAK(i, ans1)) OK(i, ans1);
    }
  }
  if (ans1 < n) {
    l = ans1 + 1;
    r = n;
    bs(l, r, true);
    for (int i{l}; i <= r; ++i) {
      if (TAK(i, ans1)) OK(i, ans1);
    }
  }
}
