#include <bits/stdc++.h>
using namespace std;
static inline void canhazfast() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
}
template <typename T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <typename T>
T extgcd(T a, T b, T &x, T &y) {
  T x0 = 1, y0 = 0, x1 = 0, y1 = 1;
  while (b) {
    T q = a / b;
    a %= b;
    swap(a, b);
    x0 -= q * x1;
    swap(x0, x1);
    y0 -= q * y1;
    swap(y0, y1);
  }
  x = x0;
  y = y0;
  return a;
}
int ctz(unsigned x) { return __builtin_ctz(x); }
int ctzll(unsigned long long x) { return __builtin_ctzll(x); }
int clz(unsigned x) { return __builtin_clz(x); }
int clzll(unsigned long long x) { return __builtin_clzll(x); }
int popcnt(unsigned x) { return __builtin_popcount(x); }
int popcntll(unsigned long long x) { return __builtin_popcountll(x); }
int bsr(unsigned x) { return 31 ^ clz(x); }
int bsrll(unsigned long long x) { return 63 ^ clzll(x); }
bool query(int x, int y) {
  string re;
  cout << "1 " << x << ' ' << y << endl;
  cin >> re;
  return re == "TAK";
}
void answer(int x, int y) { cout << "2 " << x << ' ' << y << endl; }
int f(int b, int e) {
  while (b < e) {
    int m = (b + e) / 2;
    if (query(m, m + 1))
      e = m;
    else
      b = m + 1;
  }
  return b;
}
int main() {
  canhazfast();
  int n, k, p1, p2;
  string re;
  cin >> n >> k;
  p1 = f(1, n);
  if (p1 == 1) return answer(p1, f(p1 + 1, n)), 0;
  if (p1 == n) return answer(p1, f(1, p1 - 1)), 0;
  p2 = f(1, p1 - 1);
  if (p2 == p1 - 1 && !query(p2, p1)) p2 = f(p1 + 1, n);
  answer(p1, p2);
  return 0;
}
