#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, start, ends, flag = 0, left, right, m1, m2 = 0;
  string s;
  cin >> n >> k;
  start = 1;
  ends = n;
  while (start <= ends) {
    if (start == ends) {
      m1 = start;
      break;
    }
    left = (start + ends) / 2;
    right = left + 1;
    cout << 1 << " " << left << " " << right << endl;
    cout.flush();
    cin >> s;
    if (s == "TAK") {
      ends = left;
    } else {
      start = right;
    }
  }
  start = 1;
  ends = m1 - 1;
  while (start <= ends) {
    if (start == ends) {
      m2 = start;
      break;
    }
    left = (start + ends) / 2;
    right = left + 1;
    cout << 1 << " " << left << " " << right << endl;
    cout.flush();
    cin >> s;
    if (s == "TAK") {
      ends = left;
    } else {
      start = right;
    }
  }
  s = "TAK";
  if (m2 != 0) {
    cout << 1 << " " << m2 << " " << m1 << endl;
    cout.flush();
    cin >> s;
  }
  if (s == "NIE" || m2 == 0) {
    start = m1 + 1;
    ends = n;
    while (start <= ends) {
      if (start == ends) {
        m2 = start;
        break;
      }
      left = (start + ends) / 2;
      right = left + 1;
      cout << 1 << " " << left << " " << right << endl;
      cout.flush();
      cin >> s;
      if (s == "TAK") {
        ends = left;
      } else {
        start = right;
      }
    }
  }
  cout << 2 << " " << m1 << " " << m2 << endl;
}
