#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
using LL = long long;
template <typename T>
using V = vector<T>;
template <typename T, typename S>
using P = pair<T, S>;
using LD = long double;
template <typename T, typename S>
void check(T& a, const S& b) {
  if (a >= b) {
    a %= b;
  }
}
template <typename T>
T gcd(T u, T v) {
  if (u == v) return u;
  if (u == 0) return v;
  if (v == 0) return u;
  if (~u & 1) {
    if (v & 1)
      return gcd(u >> 1, v);
    else
      return gcd(u >> 1, v >> 1) << 1;
  }
  if (~v & 1) return gcd(u, v >> 1);
  if (u > v) return gcd((u - v) >> 1, v);
  return gcd((v - u) >> 1, u);
}
int find(int a, int b) {
  int ite = 2;
  while (a < b) {
    int mid = (a + b) >> 1;
    cout << 1 << ' ' << mid << ' ' << mid + 1 << endl;
    fflush(stdout);
    string temp;
    cin >> temp;
    if (temp == "TAK") {
      b = mid;
    } else
      a = mid + 1;
  }
  return a;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cerr.tie(NULL);
  ;
  int n, k;
  cin >> n >> k;
  int pos = find(1, n);
  int pos2 = find(1, pos - 1);
  cout << 1 << ' ' << pos2 << ' ' << pos2 + 1 << endl;
  fflush(stdout);
  string temp;
  cin >> temp;
  if (temp != "TAK" || pos == pos2) {
    pos2 = find(pos + 1, n);
  }
  cout << 2 << ' ' << pos << ' ' << pos2 << endl;
  cerr << "Time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms"
       << '\n';
  return 0;
}
