#include <bits/stdc++.h>
using namespace std;
template <class t>
inline t read(t &x) {
  char c = getchar();
  bool f = 0;
  x = 0;
  while (!isdigit(c)) f |= c == '-', c = getchar();
  while (isdigit(c)) x = (x << 1) + (x << 3) + (c ^ 48), c = getchar();
  if (f) x = -x;
  return x;
}
template <class t>
inline void write(t x) {
  if (x < 0)
    putchar('-'), write(-x);
  else {
    if (x > 9) write(x / 10);
    putchar('0' + x % 10);
  }
}
int n, k;
bool que(int x, int y) {
  cout << 1 << " " << x << " " << y << endl;
  string s;
  cin >> s;
  return s == "NIE";
}
signed main() {
  read(n);
  read(k);
  int l = 1, r = n, p, pp, ppp;
  while (l + 1 <= r) {
    int mid = l + r >> 1;
    if (que(mid, mid + 1))
      l = mid + 1;
    else
      r = mid;
  }
  p = pp = ppp = l;
  l = 1, r = p - 1;
  while (l + 1 <= r) {
    int mid = l + r >> 1;
    if (que(mid, mid + 1))
      l = mid + 1;
    else
      r = mid;
  }
  if (!que(p, l) && !que(l, p)) pp = l;
  l = p + 1, r = n;
  while (l + 1 <= r) {
    int mid = l + r >> 1;
    if (que(mid, mid + 1))
      l = mid + 1;
    else
      r = mid;
  }
  if (l <= n)
    if (!que(p, l) && !que(l, p)) ppp = l;
  cout << 2 << " " << min({p, pp, ppp}) << " " << max({p, pp, ppp}) << endl;
}
