#include <bits/stdc++.h>
using namespace std;
template <typename P, unsigned long long int mod>
class Mod {
 public:
  Mod() : v_() {}

 public:
  template <typename V>
  P& operator=(const V&& rv) {
    static_assert(std::is_integral<V>::value, "should be integral type");
    v_ = rv;
    return v_;
  }
  template <typename V>
  P& operator+=(const V&& rv) {
    static_assert(std::is_integral<V>::value, "should be integral type");
    v_ += rv;
    return v_;
  }

 private:
  P v_;
};
const int sz = 1e5;
int Count = 0;
bool agent(int x, int y) {
  int num[10] = {22, 56, 1033, 5677, 7788, 10123, 44566, 88999, 90000, 95980};
  int d1 = 1e6;
  int d2 = 1e6;
  for (int i = 0; i < 10; ++i) {
    d1 = min(d1, abs(x - num[i]));
    d2 = min(d2, abs(y - num[i]));
  }
  return d1 <= d2;
}
bool query(int x, int y) {
  cout << 1 << " " << x << " " << y << endl;
  fflush(stdout);
  string ans;
  cin >> ans;
  return ans == "TAK";
}
int Search(int l, int r) {
  while (l < r) {
    int m = l + (r - l) / 2;
    if (query(m, m + 1)) {
      r = m;
    } else {
      l = m + 1;
    }
  }
  return r;
}
pair<int, int> solve(int n, int k) {
  int one = Search(1, n);
  int sec = Search(1, one - 1);
  if (sec <= 0 || !query(sec, one)) {
    return make_pair(one, Search(one + 1, n));
  }
  return make_pair(one, sec);
}
int main() {
  ios::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  pair<int, int> ans = solve(n, k);
  if (ans.first > ans.second) {
    swap(ans.first, ans.second);
  }
  cout << 2 << " " << ans.first << " " << ans.second << endl;
}
