#include <bits/stdc++.h>
using namespace std;
int n, k;
string s;
int binSearch(int l, int r) {
  while (l < r) {
    int m = (l + r) >> 1;
    cout << "1 " << m << ' ' << m + 1 << '\n' << flush;
    cin >> s;
    if (s == "NIE")
      l = m + 1;
    else
      r = m;
  }
  return l;
}
int main(int argc, char** argv) {
  cin >> n >> k;
  int x = binSearch(1, n);
  int y = binSearch(1, x - 1);
  cout << "1 " << y << ' ' << x << '\n' << flush;
  cin >> s;
  if (s == "NIE" || x == y) y = binSearch(x + 1, n);
  cout << "2 " << x << ' ' << y << '\n';
  return 0;
}
