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