#include <bits/stdc++.h>
const long long inf = 0x3f3f3f3f3f3f3f3f;
using std::max;
using std::min;
inline long long readll(void) {
  long long x = 0, w = 1;
  char ch = getchar();
  for (; ch < '0' || ch > '9'; ch - '-' || (w = -w), ch = getchar())
    ;
  for (; ch >= '0' && ch <= '9';
       x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar())
    ;
  return x * w;
}
inline void writell(long long x, int c = '\0') {
  static long long s[112];
  long long* n = s;
  while (x || n == s) *++n = x % 10, x /= 10;
  while (n != s) putchar(*n-- ^ 48);
  if (c) putchar(c);
}
inline long long iabs(long long x) { return max(x, -x); }
inline int readchar(void) {
  int ch = getchar();
  for (; ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t'; ch = getchar())
    ;
  return ch;
}
const long long mod = 1e9 + 7;
long long a[1145141];
long long getans(long long a, long long b) {
  printf("1 %lld %lld\n", a, b), fflush(stdout);
  char x[114];
  scanf("%s", x);
  return *x != 'N';
}
void submit(long long a, long long b) {
  printf("2 %lld %lld\n", a, b), fflush(stdout);
}
int main(void) {
  long long n = readll(), k = readll();
  long long w1 = -1, w2 = -1, w3 = -1;
  for (register long long l = 1, r = n, mid;
       mid = (l + r) >> 1, l >= r ? w1 = l, 0 : 1;)
    if (getans(mid, mid + 1))
      r = mid;
    else
      l = mid + 1;
  for (register long long l = 1, r = w1 - 1, mid;
       mid = (l + r) >> 1, l >= r ? w2 = l, 0 : 1;)
    if (getans(mid, mid + 1))
      r = mid;
    else
      l = mid + 1;
  for (register long long l = w1 + 1, r = n, mid;
       mid = (l + r) >> 1, l >= r ? w3 = l, 0 : 1;)
    if (getans(mid, mid + 1))
      r = mid;
    else
      l = mid + 1;
  submit(w1, w1 ^ w2 && getans(w1, w2) && getans(w2, w1) ? w2 : w3);
  return 0;
}
