#include <bits/stdc++.h>
using namespace std;
const long long N = 3e5 + 5;
const long long mod = 1e9 + 7;
bool query(long long x, long long y) {
  string str;
  cout << "1 " << x << " " << y << endl;
  cin >> str;
  return str == "TAK";
}
long long func(long long l, long long r) {
  while (r - l >= 3) {
    long long mid = (l + r) / 2;
    bool flg = query(mid, mid + 1);
    if (flg)
      r = mid;
    else
      l = mid + 1;
  }
  if (r - l == 0) return l;
  if (r - l == 1) return query(l, l + 1) ? l : l + 1;
  if (r - l == 2) {
    bool f = query(l, r), s = query(r, l);
    if (f && !s) return l;
    if (!f && s) return r;
    return query(l, l + 1) ? l : l + 1;
  }
  return -1;
}
long long n, k;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> k;
  long long i = func(1, n);
  long long j1 = func(1, i - 1), j2 = func(i + 1, n);
  long long j = j1;
  if (j1 == -1 || !query(i, j1) || !query(j1, i)) j = j2;
  cout << "2 " << i << " " << j << endl;
}
