#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char a = getchar();
  while (a < '0' || a > '9') {
    if (a == '-') f = -1;
    a = getchar();
  }
  while (a >= '0' && a <= '9') x = x * 10 + a - '0', a = getchar();
  return x * f;
}
int n, k, x, y;
char s[5];
inline bool check(int a) {
  printf("1 %d %d\n", a, a + 1);
  fflush(stdout);
  scanf("%s", s);
  if (s[0] == 'N')
    return 0;
  else
    return 1;
}
inline int solve(int l, int r) {
  if (l > r) return 0;
  while (l < r) {
    int mid = (l + r) >> 1;
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
  }
  return l;
}
int main() {
  n = read();
  k = read();
  x = solve(1, n);
  y = solve(1, x - 1);
  y = y && (y < x - 1 || check(y)) ? y : solve(x + 1, n);
  printf("2 %d %d\n", x, y);
  return 0;
}
