#include <bits/stdc++.h>
using namespace std;
vector<int> ans;
int main() {
  int n, k;
  cin >> n >> k;
  int l = 1, r = n;
  string s;
  while (r - l > 0) {
    int m = (l + r) >> 1;
    cout << "1 " << m << " " << m + 1 << endl;
    cin >> s;
    if (s == "NIE") {
      l = m + 1;
    } else {
      r = m;
    }
  }
  ans.push_back(l);
  l = 1, r = ans[0] - 1;
  while (r - l > 0) {
    int m = (l + r) >> 1;
    cout << "1 " << m << " " << m + 1 << endl;
    cin >> s;
    if (s == "NIE") {
      l = m + 1;
    } else {
      r = m;
    }
  }
  if (r == l) {
    cout << "1 " << l << " " << ans[0] << endl;
    cin >> s;
    if (s != "NIE") ans.push_back(l);
  }
  l = ans[0] + 1, r = n;
  while (r - l > 0) {
    int m = (l + r) >> 1;
    cout << "1 " << m + 1 << " " << m << endl;
    cin >> s;
    if (s == "NIE") {
      r = m;
    } else {
      l = m + 1;
    }
  }
  if (r == l) {
    cout << "1 " << l << " " << ans[0] << endl;
    cin >> s;
    if (s != "NIE") ans.push_back(l);
  }
  cout << "2 " << ans[0] << " " << ans[1] << endl;
  return 0;
}
