#include <bits/stdc++.h>
using namespace std;
string s;
int find(int p, int q) {
  int mid;
  while (p < q) {
    mid = (p + q) / 2;
    cout << 1 << " " << mid << " " << mid + 1 << endl;
    cin >> s;
    if (s == "NIE")
      p = mid + 1;
    else
      q = mid;
  }
  return p;
}
int main() {
  int n, k, g1, g2;
  cin >> n >> k;
  g1 = find(1, n);
  g2 = find(1, g1 - 1);
  cout << 1 << " " << g2 << " " << g1 << endl;
  cin >> s;
  if (s == "NIE" || g1 == g2) g2 = find(g1 + 1, n);
  cout << 2 << " " << g1 << " " << g2 << endl;
}
