#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
double PI = 4 * atan(1);
vector<long long> x;
long long sum = 0, po2[400000];
int fin(int lo, int hi) {
  if (lo == hi) return lo;
  int a = (lo + hi) / 2;
  int b = a + 1;
  cout << "1 " << a << " " << b << endl;
  string r;
  cin >> r;
  if (r == "TAK")
    return fin(lo, a);
  else
    return fin(b, hi);
}
int main() {
  int n, k;
  cin >> n >> k;
  int z = fin(1, n);
  int lo = 1, hi = n;
  while (lo < z) {
    int mid = (lo + z - 1) / 2;
    cout << "1 " << mid << " " << mid + 1 << endl;
    string r;
    cin >> r;
    if (r == "TAK") {
      int z1 = fin(lo, mid);
      cout << "2 " << z << " " << z1 << endl;
      return 0;
    } else
      lo = mid + 1;
  }
  while (hi > z) {
    int mid = (z + hi) / 2 + 1;
    cout << "1 " << mid << " " << mid - 1 << endl;
    string r;
    cin >> r;
    if (r == "TAK") {
      int z1 = fin(mid, hi);
      cout << "2 " << z << " " << z1 << endl;
      return 0;
    } else
      hi = mid - 1;
  }
}
