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