#include <bits/stdc++.h>
using namespace std;
long long n, k;
string s;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> k;
  long long left = 1;
  long long right = n;
  while (right - left > 1) {
    long long m1 = (right + left) / 2;
    long long m2 = m1 + 1;
    cout << 1 << " " << m1 << " " << m2 << endl;
    cout.flush();
    cin >> s;
    if (s == "TAK") {
      right = m1;
    } else
      left = m2;
  }
  long long f;
  long long s1 = -1;
  long long s2 = -1;
  if (left == right)
    f = left;
  else {
    cout << 1 << " " << left << " " << right << endl;
    cout.flush();
    cin >> s;
    if (s == "TAK") {
      f = left;
    } else
      f = right;
  }
  left = 1;
  right = f - 1;
  if (right >= left) {
    while (right - left > 1) {
      long long m1 = (right + left) / 2;
      long long m2 = m1 + 1;
      cout << 1 << " " << m1 << " " << m2 << endl;
      cout.flush();
      cin >> s;
      if (s == "TAK") {
        right = m1;
      } else
        left = m2;
    }
    if (left == right)
      s1 = left;
    else {
      cout << 1 << " " << left << " " << right << endl;
      cout.flush();
      cin >> s;
      if (s == "TAK") {
        s1 = left;
      } else
        s1 = right;
    }
  }
  left = f + 1;
  right = n;
  if (right >= left) {
    while (right - left > 1) {
      long long m1 = (right + left) / 2;
      long long m2 = m1 + 1;
      cout << 1 << " " << m1 << " " << m2 << endl;
      cout.flush();
      cin >> s;
      if (s == "TAK") {
        right = m1;
      } else
        left = m2;
    }
    if (left == right)
      s2 = left;
    else {
      cout << 1 << " " << left << " " << right << endl;
      cout.flush();
      cin >> s;
      if (s == "TAK") {
        s2 = left;
      } else
        s2 = right;
    }
  }
  if (s1 != -1) {
    cout << "1 " << s1 << " " << f << endl;
    cout.flush();
    cin >> s;
    if (s == "TAK") {
      cout << 2 << " " << f << " " << s1 << endl;
      cout.flush();
      return 0;
    }
  }
  cout << 2 << " " << f << " " << s2 << endl;
  cout.flush();
  return 0;
}
