#include <bits/stdc++.h>
using namespace std;
bool query(int x, int y) {
  if (x == -1 || y == -1) return 0;
  cout << "1 " << x << " " << y << endl;
  string ret;
  cin >> ret;
  return (ret == "TAK");
}
int find(int l, int d) {
  if (l > d) return -1;
  while (l < d) {
    int mid = (l + d) / 2;
    if (query(mid, mid + 1))
      d = mid;
    else
      l = mid + 1;
  }
  return l;
}
int main() {
  int n, k;
  cin >> n >> k;
  int a = find(1, n);
  int b = find(1, a - 1);
  if (!query(b, a)) b = find(a + 1, n);
  cout << "2 " << a << " " << b << endl;
  return 0;
}
