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