#include <bits/stdc++.h>
using namespace std;
int n, k, x, y;
int main() {
  cin >> n >> k;
  int l = 1, r = n, mid;
  while (l <= r) {
    if (l == r) {
      x = l;
      break;
    }
    mid = l + r >> 1;
    cout << "1 " << mid << ' ' << mid + 1 << endl;
    fflush(stdout);
    string s;
    cin >> s;
    if (s == "TAK")
      r = mid;
    else
      l = mid + 1;
  }
  l = 1, r = x - 1;
  while (l <= r) {
    if (l == r) {
      y = l;
      break;
    }
    mid = l + r >> 1;
    cout << "1 " << mid << ' ' << mid + 1 << endl;
    fflush(stdout);
    string s;
    cin >> s;
    if (s == "TAK")
      r = mid;
    else
      l = mid + 1;
  }
  if (y > 0) {
    cout << "1 " << y << ' ' << x << endl;
    fflush(stdout);
    string s;
    cin >> s;
    if (s == "TAK") {
      cout << "2 " << x << ' ' << y << endl;
      fflush(stdout);
      return 0;
    }
  }
  l = x + 1, r = n;
  while (l <= r) {
    if (l == r) {
      y = l;
      break;
    }
    mid = l + r >> 1;
    cout << "1 " << mid << ' ' << mid + 1 << endl;
    fflush(stdout);
    string s;
    cin >> s;
    if (s == "TAK")
      r = mid;
    else
      l = mid + 1;
  }
  cout << "2 " << x << ' ' << y << endl;
  fflush(stdout);
  return 0;
}
