#include <bits/stdc++.h>
using namespace std;
void output(int x, int y) {
  printf("2 %d %d\n", x, y);
  fflush(stdout);
  exit(0);
}
char s[10];
int getsm(int l, int r) {
  printf("1 %d %d\n", l, r);
  fflush(stdout);
  scanf("%s", s);
  return s[0] == 'T' ? l : r;
}
int n, k;
int getone(int l, int r) {
  while (l + 1 < r) {
    int mid = (l + r) >> 1;
    if (getsm(mid, mid + 1) == mid)
      r = mid;
    else
      l = mid + 1;
  }
  if (l == r) return l;
  return getsm(l, r);
}
int main() {
  scanf("%d%d", &n, &k);
  int fr = getone(1, n);
  if (fr == 1) {
    output(fr, getone(2, n));
  } else if (fr == n) {
    output(fr, getone(1, n - 1));
  } else {
    int x1 = getone(1, fr - 1), x2 = getone(fr + 1, n);
    output(fr, getsm(x1, x2));
  }
  return 0;
}
