#include <bits/stdc++.h>
using namespace std;
int n, k;
int memo[100100];
bool query(int a, int b) {
  if (~memo[a]) return memo[a];
  printf("1 %d %d\n", a, b);
  fflush(stdout);
  char str[10];
  scanf("%s", str);
  return memo[a] = str[0] == 'T';
}
int bb1(int a, int b) {
  while (a < b) {
    int m = (a + b) >> 1;
    if (query(m, m + 1))
      b = m;
    else
      a = m + 1;
  }
  if (!query(a, a + 1)) return a + 1;
  return a;
}
int dc1(int a, int b) {
  while (a <= b) {
    int c = (a + b) >> 1;
    if (query(c, c + 1)) return bb1(1, c);
    a = c + 1;
  }
  return 0;
}
int dc2(int a, int b) {
  while (a <= b) {
    int c = (a + b + 1) >> 1;
    if (!query(c, c + 1)) return bb1(c, n - 1);
    b = c - 1;
  }
  return a;
}
int main() {
  memset(memo, -1, sizeof(memo));
  scanf("%d%d", &n, &k);
  int a = bb1(1, n - 1);
  int b = dc1(1, a - 1);
  if (!b) b = dc2(a + 1, n - 1);
  printf("2 %d %d\n", a, b);
}
