#include <bits/stdc++.h>
using namespace std;
const long long M = 1e9 + 7;
int n, k;
bool check(int l, int r) {
  if (l < 0) return false;
  if (r > n) return false;
  cout << 1 << " " << l << " " << r << endl;
  string s;
  cin >> s;
  return (s == "TAK");
}
int get(int l, int r) {
  if (l > r) return -1;
  while (l < r) {
    int m = (l + r) >> 1;
    if (check(m, m + 1)) {
      r = m;
    } else {
      l = m + 1;
    }
  }
  return l;
}
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k;
  int ans1 = get(1, n);
  int ans2 = get(1, ans1 - 1);
  if (!check(ans2, ans1)) {
    ans2 = get(ans1 + 1, n);
  }
  cout << 2 << " " << ans1 << " " << ans2 << endl;
  return 0;
}
