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