#include <bits/stdc++.h>
using namespace std;
int n, k;
bool resp;
void out(int a, int b, int c, bool d = false) {
  cout << a << ' ' << b << ' ' << c << '\n';
  fflush(stdin);
  if (!d) {
    string s;
    cin >> s;
    resp = (s == "TAK");
  }
}
int bs(int lo, int hi) {
  while (lo < hi) {
    int mid = lo + (hi - lo) / 2;
    out(1, mid, mid + 1);
    if (resp)
      hi = mid;
    else
      lo = mid + 1;
  }
  return lo;
}
int main() {
  cin >> n >> k;
  int ans = bs(1, n), z[2] = {bs(1, ans - 1), bs(ans + 1, n)};
  for (int i = 0; i < 2; ++i) {
    if (z[i] == ans || z[i] < 1 || z[i] > n) continue;
    out(1, z[i], ans);
    if (resp) {
      out(2, ans, z[i], true);
      return 0;
    }
  }
}
