#include <bits/stdc++.h>
using namespace std;
bool check(int l, int r) {
  printf("1 %d %d\n", l, r);
  fflush(stdout);
  char str[10];
  scanf("%s", str);
  return (str[0] == 'T');
}
int query(int l, int r) {
  if (l == r) {
    return l;
  } else if (r == l + 1) {
    bool flag = check(l, r);
    if (flag)
      return l;
    else
      return r;
  } else {
    int mid = l + (r - l) / 2;
    bool flag = check(mid, mid + 1);
    if (flag)
      return query(l, mid);
    else
      return query(mid + 1, r);
  }
}
int main() {
  int n, k, i, j;
  scanf("%d", &n);
  scanf("%d", &k);
  int ans1 = query(1, n);
  if (ans1 == 1) {
    printf("2 %d %d\n", ans1, query(2, n));
    return 0;
  } else if (ans1 == n) {
    printf("2 %d %d\n", ans1, query(1, n - 1));
  } else {
    int ans2 = query(1, ans1 - 1);
    if (check(ans2, ans2 + 1)) {
      if (ans2 - 1 >= 1) {
        if (check(ans2, ans2 - 1)) {
          printf("2 %d %d\n", ans1, ans2);
          return 0;
        }
      } else {
        printf("2 %d %d\n", ans1, ans2);
        return 0;
      }
    }
    ans2 = query(ans1 + 1, n);
    printf("2 %d %d\n", ans1, ans2);
    return 0;
  }
  return 0;
}
