#include <bits/stdc++.h>
const long long inf = std::numeric_limits<long long>::max();
const long long mod = 1e9 + 7;
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int bis(int l, int r) {
  if (l == r) return r;
  int mid = (l + r) / 2;
  cout << 1 << ' ' << mid << ' ' << mid + 1 << endl;
  string st;
  cin >> st;
  if (st[0] == 'T') {
    if (l == r - 1) return l;
    return bis(l, mid);
  } else {
    if (l == r - 1) return r;
    return bis(mid + 1, r);
  }
}
int chck(int ans1, int ans2) {
  cout << 1 << ' ' << ans2 << ' ' << ans1 << endl;
  string st;
  cin >> st;
  return st[0] == 'T';
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  int ans2, ans3;
  ans2 = ans3 = -1;
  int ans1 = bis(1, n);
  if (ans1 != 1) ans2 = bis(1, ans1 - 1);
  if (ans1 != n) ans3 = bis(ans1 + 1, n);
  if (ans2 != -1) {
    if (chck(ans1, ans2)) return cout << 2 << ' ' << ans1 << ' ' << ans2, 0;
  }
  ans2 = ans3;
  if (ans2 != -1) {
    if (chck(ans1, ans2)) return cout << 2 << ' ' << ans1 << ' ' << ans2, 0;
  }
  return 0;
}
