#include <bits/stdc++.h>
using namespace std;
int n, k;
bool query(int x, int y) {
  if (x < 0 || y > n) return false;
  string re;
  cout << 1 << " " << x << " " << y << "\n";
  cin >> re;
  return re == "TAK";
}
int get(int l, int r) {
  if (l > r) return -1;
  while (l < r) {
    int mid = (l + r) / 2;
    if (query(mid, mid + 1))
      r = mid;
    else
      l = mid + 1;
  }
  return l;
}
int main() {
  scanf("%d%d", &n, &k);
  int x, y;
  x = get(1, n);
  y = get(1, x - 1);
  if (!query(y, x)) y = get(x + 1, n);
  printf("2 %d %d\n", x, y);
  return 0;
}
