#include <bits/stdc++.h>
using namespace std;
int n, k, a, b, c;
char s[10];
bool querry(int x, int y) {
  printf("1 %d %d\n", x, y);
  fflush(stdout);
  scanf("%s", s);
  return s[0] == 'T';
}
int bs(int lo, int hi) {
  while (lo < hi) {
    int mid1 = (lo + hi) / 2;
    int mid2 = mid1 + 1;
    if (querry(mid1, mid2))
      hi = mid1;
    else
      lo = mid2;
  }
  return lo;
}
int main() {
  scanf("%d %d", &n, &k);
  a = bs(1, n);
  b = bs(1, a - 1);
  c = bs(a + 1, n);
  if (a == 1) {
    printf("2 %d %d\n", a, c);
    fflush(stdout);
    return 0;
  }
  if (a == n) {
    printf("2 %d %d\n", a, b);
    fflush(stdout);
    return 0;
  }
  if (querry(b, c))
    printf("2 %d %d\n", a, b);
  else
    printf("2 %d %d\n", a, c);
  fflush(stdout);
  return 0;
}
