#include <bits/stdc++.h>
char buf[5];
bool test(int a, int b) {
  printf("1 %d %d\n", a, b);
  fflush(stdout);
  scanf("%s", buf);
  if (buf[0] == 'T') {
    return true;
  }
  return false;
}
int solve(int a, int b) {
  if (a == b) {
    return a;
  } else if (a > b) {
    return -1;
  }
  int d = b - a + 1;
  if (d == 2) {
    return test(a, b) ? a : b;
  } else if (d == 3) {
    if (test(a + 1, a)) {
      return solve(a + 1, a + 2);
    } else {
      return solve(a, a + 1);
    }
  } else {
    int s = (d + 3) / 4;
    int x = a + s;
    int y = b - s;
    if (x == y) {
      --x, ++y;
    }
    int mid = (x + y) / 2;
    if (test(x, y)) {
      return solve(a, mid);
    } else {
      while (mid - x <= y - mid) {
        ++mid;
      }
      return solve(mid, b);
    }
  }
}
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  int a = solve(1, n);
  int b = solve(1, a - 1);
  int c = solve(a + 1, n);
  int d = 0;
  if (b < 0) {
    d = c;
  } else if (c < 0) {
    d = b;
  } else if (test(b, a)) {
    d = b;
  } else {
    d = c;
  }
  printf("2 %d %d\n", a, d);
  return 0;
}
