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