#include <bits/stdc++.h>
using namespace std;
char c[10];
int n, k;
inline bool get() {
  scanf("%s", c);
  return c[0] == 'T';
}
bool check(int y, int x) {
  if (x == y || y > n || y < 1) return false;
  printf("1 %d %d\n", y, x);
  fflush(stdout);
  return get();
}
inline int find(int left, int right) {
  if (left >= right) return left;
  if ((right - left) & 1) {
    int m1 = (left + right) / 2;
    int m2 = m1 + 1;
    printf("1 %d %d\n", m1, m2);
    fflush(stdout);
    return get() ? find(left, m1) : find(m2, right);
  } else {
    int m = (left + right) / 2;
    printf("1 %d %d\n", m - 1, m + 1);
    fflush(stdout);
    return get() ? find(left, m) : find(m, right);
  }
}
int main() {
  scanf("%d%d", &n, &k);
  int x = find(1, n);
  int y = find(1, x - 1);
  if (!check(y, x)) y = find(x + 1, n);
  printf("2 %d %d\n", x, y);
  fflush(stdout);
  return 0;
}
