#include <bits/stdc++.h>
using namespace std;
int n, k;
bool queryit(int x, int y) {
  cout << "1 " << x + 1 << " " << y + 1 << endl << flush;
  string ans;
  cin >> ans;
  return ans[0] == 'T';
}
int findit(int L, int R) {
  if (L == R) return L;
  int mid = (L + R) / 2;
  if (queryit(mid, mid + 1))
    return findit(L, mid);
  else {
    return findit(mid + 1, R);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k;
  int r1 = findit(0, n - 1);
  int r2;
  if (r1 == n - 1)
    r2 = findit(0, n - 2);
  else {
    r2 = findit(r1 + 1, n - 1);
    if (!queryit(r2, r1)) r2 = findit(0, r1 - 1);
  }
  cout << "2 " << r1 + 1 << " " << r2 + 1 << endl;
  return 0;
}
