#include <bits/stdc++.h>
using namespace std;
int it = 0;
int find(int l, int r, int k) {
  if (l == r) return l;
  int ras = (r - l + 1) / 2;
  int ll, rr;
  if (k == 0) {
    ll = l + ras - 1;
    rr = l + ras;
  } else {
    ll = r - ras;
    rr = ll + 1;
  }
  if (k == 0) {
    assert(it != 60);
    cout << 1 << ' ' << ll << ' ' << rr << endl;
    ++it;
  } else {
    assert(it != 60);
    cout << 1 << ' ' << rr << ' ' << ll << endl;
    ++it;
  }
  string s;
  cin >> s;
  if (s[0] == 'T') {
    if (k == 0) {
      return find(l, rr - 1, k);
    } else {
      return find(ll + 1, r, k);
    }
  } else {
    if (k == 0) {
      return find(ll + 1, r, k);
    } else {
      return find(l, rr - 1, k);
    }
  }
}
signed main() {
  int n, k;
  cin >> n >> k;
  int cur = find(1, n, 0);
  set<int> sss;
  sss.insert(cur);
  sss.insert(find(1, cur, 0));
  sss.insert(find(cur, n, 1));
  cout << 2 << ' ' << *sss.begin() << ' ' << *(++sss.begin()) << endl;
  return 0;
}
