#include <bits/stdc++.h>
using namespace std;
int n, k;
char cmd[10];
int ans[2];
int ask(int x, int y) {
  printf("1 %d %d\n", x, y);
  fflush(stdout);
  scanf("%s", cmd);
  if (cmd[0] == 'T')
    return 0;
  else
    return 1;
}
int binarysearch(int L, int R) {
  if (L > R) return -1;
  int M;
  while (L < R) {
    M = (L + R) >> 1;
    int res = ask(M, M + 1);
    if (res == 0) {
      R = M;
    } else {
      L = M + 1;
    }
  }
  return L;
}
void solve();
int main() {
  scanf("%d %d", &n, &k);
  solve();
}
void solve() {
  ans[0] = binarysearch(1, n);
  ans[1] = binarysearch(1, ans[0] - 1);
  if (ans[1] == -1 || ask(ans[1], ans[0]) == 1) {
    ans[1] = binarysearch(ans[0] + 1, n);
  }
  printf("2 %d %d\n", ans[0], ans[1]);
  fflush(stdout);
}
