#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n, k;
int ans1, ans2;
char s[10];
void solve() {
  int l = 1, r = n;
  while (l <= r) {
    if (l == r) {
      ans1 = l;
      break;
    }
    int len = r - l + 1;
    int l1, r1, l2, r2;
    if (len == 3) {
      l1 = l, r1 = l + 1;
      l2 = l + 1, r2 = r;
      printf("1 %d %d\n", l, r);
      fflush(stdout);
    } else {
      int slen = (len + 1) >> 1;
      if (slen % 2 == 0) slen++;
      l1 = l, r1 = l + slen - 1;
      r2 = r, l2 = r - slen + 1;
      int ask1 = (l1 + r1) >> 1;
      int ask2 = (l2 + r2) >> 1;
      printf("1 %d %d\n", ask1, ask2);
      fflush(stdout);
    }
    scanf("%s", s);
    if (s[0] == 'T')
      l = l1, r = r1;
    else
      l = l2, r = r2;
  }
  int llen = ans1 - 1, rlen = n - ans1;
  if (llen == 0)
    l = ans1 + 1, r = n;
  else if (rlen == 0)
    l = 1, r = ans1 - 1;
  else if (llen <= rlen) {
    int l1 = 1, r1 = ans1 - 1;
    int l2 = ans1 + 1, r2 = n;
    int ask2 = (l1 + r1) >> 1;
    int ask1 = 2 * ans1 - ask2;
    printf("1 %d %d\n", ask1, ask2);
    fflush(stdout);
    scanf("%s", s);
    if (s[0] == 'T')
      l = l2, r = r2;
    else
      l = l1, r = r1;
  } else {
    int l1 = 1, r1 = ans1 - 1;
    int l2 = ans1 + 1, r2 = n;
    int ask2 = (l2 + r2 + 1) >> 1;
    int ask1 = 2 * ans1 - ask2;
    printf("1 %d %d\n", ask1, ask2);
    fflush(stdout);
    scanf("%s", s);
    if (s[0] == 'T')
      l = l1, r = r1;
    else
      l = l2, r = r2;
  }
  while (l <= r) {
    if (l == r) {
      ans2 = l;
      break;
    }
    int len = r - l + 1;
    int l1, r1, l2, r2;
    if (len == 3) {
      l1 = l, r1 = l + 1;
      l2 = l + 1, r2 = r;
      printf("1 %d %d\n", l, r);
      fflush(stdout);
    } else {
      int slen = (len + 1) >> 1;
      if (slen % 2 == 0) slen++;
      l1 = l, r1 = l + slen - 1;
      r2 = r, l2 = r - slen + 1;
      int ask1 = (l1 + r1) >> 1;
      int ask2 = (l2 + r2) >> 1;
      printf("1 %d %d\n", ask1, ask2);
      fflush(stdout);
    }
    scanf("%s", s);
    if (s[0] == 'T')
      l = l1, r = r1;
    else
      l = l2, r = r2;
  }
  if (ans1 > ans2) swap(ans1, ans2);
  printf("2 %d %d\n", ans1, ans2);
}
int main() {
  scanf("%d%d", &n, &k);
  solve();
  return 0;
}
