#include <bits/stdc++.h>
using namespace std;
int n, k, dish1, dish2;
char respond[5];
int query(int x, int y) {
  printf("1 %d %d\n", x, y);
  fflush(stdout);
  scanf("%s", respond);
  if (respond[0] == 'T') {
    return true;
  }
  return false;
}
bool is_really(int pos) {
  if (pos - 1 > 0 && query(pos, pos - 1)) return true;
  if (pos + 1 <= n && query(pos, pos + 1)) return true;
  return false;
}
int get(int l, int r) {
  if (l > r) return -1;
  while (l < r) {
    int mid = (l + r) / 2;
    if (query(mid, mid + 1))
      r = mid;
    else
      l = mid + 1;
  }
  return l;
}
int main() {
  scanf("%d %d", &n, &k);
  dish1 = get(1, n);
  if (dish1 == 1) {
    dish2 = get(dish1 + 1, n);
  } else if (dish1 == n) {
    dish2 = get(1, dish1 - 1);
  } else {
    int v1 = get(1, dish1 - 1), v2 = get(dish1 + 1, n);
    dish2 = v1;
    if (!query(v1, v2)) dish2 = v2;
  }
  printf("2 %d %d\n", dish1, dish2);
  fflush(stdout);
  return 0;
}
