#include <bits/stdc++.h>
long n;
bool query(long x, long y) {
  printf("1 %ld %ld\n", x, y);
  fflush(stdout);
  char s[10];
  scanf("%s", s);
  return !strcmp(s, "TAK");
}
long search(long l, long r) {
  while (l < r) {
    long mid = (l + r) / 2;
    if (query(mid, mid + 1))
      r = mid;
    else
      l = mid + 1;
  }
  return r;
}
int main() {
  long k;
  scanf("%ld%ld", &n, &k);
  long first = search(1, n), second;
  if (first == 1) {
    second = search(first + 1, n);
  } else {
    second = search(1, first - 1);
    if (!query(second, first)) second = search(first + 1, n);
  }
  printf("2 %ld %ld\n", first, second);
  return 0;
}
