#include <bits/stdc++.h>
using namespace std;
bool check(int x) {
  cout << "1 " << x << " " << x + 1 << endl;
  string res;
  cin >> res;
  return res == "TAK";
}
int find(int l, int r, int kek) {
  int sl = l, sr = r, m;
  while (l + 1 < r && l + 1 < kek) {
    m = (l + r) / 2;
    if (check(m))
      r = m;
    else
      l = m;
  }
  return min(r, kek);
}
signed main() {
  ios_base::sync_with_stdio(0);
  int n, k;
  cin >> n >> k;
  int x = find(0, n - 1, n);
  int y = find(0, x, n);
  int z = find(x, n + 1, n);
  if (y == x) y = z;
  cout << "2 " << x << " " << y << endl;
  return 0;
}
