#include <bits/stdc++.h>
using namespace std;
string s;
int n, k;
int id1, id2;
int bnsearch(int l, int r) {
  while (r - l > 1) {
    int mid = (l + r) / 2;
    cout << 1 << " " << mid << " " << mid + 1 << endl;
    fflush(stdout);
    cin >> s;
    if (s == "TAK")
      r = mid;
    else
      l = mid + 1;
  }
  int ans = 0;
  if (l == r)
    ans = l;
  else {
    cout << 1 << " " << l << " " << r << endl;
    fflush(stdout);
    cin >> s;
    if (s == "TAK")
      ans = l;
    else
      ans = r;
  }
  return ans;
}
int main() {
  cin >> n >> k;
  int l = 1, r = n;
  id1 = bnsearch(1, n);
  if (id1 != 1) {
    int t = bnsearch(1, id1 - 1);
    cout << 1 << " " << t << " " << id1 << endl;
    fflush(stdout);
    cin >> s;
    if (s == "TAK")
      id2 = t;
    else
      id2 = bnsearch(id1 + 1, n);
  } else
    id2 = bnsearch(2, n);
  cout << 2 << " " << id1 << " " << id2 << endl;
  fflush(stdout);
}
