#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, m, k, ans[5];
char s[N];
void solve(int l, int r) {
  while (l != r) {
    int mid = l + r >> 1;
    printf("1 %d %d\n", mid, mid + 1);
    fflush(stdout);
    scanf("%s", s);
    if (!strcmp(s, "NIE"))
      l = mid + 1;
    else
      r = mid;
  }
  ans[++m] = l;
}
int main() {
  scanf("%d%d", &n, &k);
  solve(1, n);
  if (ans[1] > 1) solve(1, ans[1] - 1);
  if (ans[1] < n) solve(ans[1] + 1, n);
  if (m == 2) {
    printf("2 %d %d\n", ans[1], ans[2]);
    exit(0);
  }
  printf("1 %d %d\n", ans[2], ans[3]);
  fflush(stdout);
  scanf("%s", s);
  if (!strcmp(s, "NIE")) ans[2] = ans[3];
  printf("2 %d %d\n", ans[1], ans[2]);
  return 0;
}
