#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
const double g = 10.0, eps = 1e-9;
const int N = 1000 + 10, maxn = 16, inf = 9999999;
int n;
bool query(int x, int y) {
  if (x < 0 || y > n) return 0;
  cout << 1 << " " << x << " " << y << endl;
  fflush(stdout);
  string s;
  cin >> s;
  return s == "TAK";
}
int bir(int l, int r) {
  if (l > r) return -1;
  while (l < r) {
    int m = (l + r) / 2;
    if (query(m, m + 1))
      r = m;
    else
      l = m + 1;
  }
  return l;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int x, y, k;
  cin >> n >> k;
  x = bir(1, n);
  y = bir(1, x - 1);
  if (!query(y, x)) y = bir(x + 1, n);
  cout << 2 << " " << x << " " << y << endl;
  return 0;
}
