#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
bool ask(int a, int b) {
  cout << 1 << ' ' << a << ' ' << b << endl;
  string res;
  cin >> res;
  return (res == "TAK");
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n = 0, k = 0;
  cin >> n >> k;
  int l = 1, r = n;
  while (l < r) {
    int m = ((l + r) >> 1);
    if (ask(m, m + 1))
      r = m;
    else
      l = m + 1;
  }
  int pos1 = l;
  l = 1, r = pos1 - 1;
  while (l < r) {
    int m = ((l + r) >> 1);
    if (ask(m, m + 1))
      r = m;
    else
      l = m + 1;
  }
  if (pos1 == 1 || !ask(l, pos1)) {
    l = pos1 + 1, r = n;
    while (l < r) {
      int m = ((l + r) >> 1);
      if (ask(m, m + 1))
        r = m;
      else
        l = m + 1;
    }
  }
  int pos2 = l;
  cout << 2 << ' ' << pos1 << ' ' << pos2 << endl;
  return 0;
}
