#include <bits/stdc++.h>
using namespace std;
char S[5];
inline int get(int l, int r, bool f) {
  while (r - l > 1) {
    int m = (l + r) >> 1;
    if (f)
      printf("1 %d %d\n", m, m + 1);
    else
      printf("1 %d %d\n", m + 1, m);
    fflush(stdout);
    scanf("%s", S);
    if (f)
      S[0] == 'T' ? r = m : l = m;
    else
      S[0] == 'T' ? l = m : r = m;
  }
  return r;
}
int main() {
  int n, k;
  scanf("%d", &n);
  ;
  scanf("%d", &k);
  ;
  int x = get(0, n, 1);
  int y = get(0, x, 1);
  if (x == y) y = get(x, n, 0);
  printf("2 %d %d", x, y);
}
