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