#include <bits/stdc++.h>
using namespace std;
int n, k;
int solve(int l, int r, int k = 0) {
  if (l > n || r > n) return -1;
  while (r - l > 1) {
    int mid = (l + r - k) / 2;
    cout << 1 << " " << mid << " " << mid + 1 << '\n' << flush;
    string ans;
    cin >> ans;
    if (ans[0] == 'T') {
      r = mid;
    } else {
      l = mid + 1;
    }
  }
  if (l == r) return l;
  cout << 1 << " " << l << " " << r << '\n' << flush;
  string ans;
  cin >> ans;
  if (ans[0] == 'T') {
    return l;
  }
  return r;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.precision(0);
  cin >> n >> k;
  int a = solve(1, n);
  int b1 = solve(1, a, 1);
  int b2 = solve(a + 1, n, -1);
  cout << 2 << " " << a << " " << (b1 < 1 || b1 == a ? b2 : b1);
  return 0;
}
