#include <bits/stdc++.h>
using namespace std;
int n, k;
bool ask(int x, int y) {
  if (x < 0 || y > n) return 0;
  string s;
  cout << 1 << " " << x << " " << y << endl;
  cin >> s;
  return s == "TAK";
}
int solve(int l, int r) {
  if (l > r) return -1;
  int mid;
  while (l < r) {
    mid = (l + r) >> 1;
    if (ask(mid, mid + 1))
      r = mid;
    else
      l = mid + 1;
  }
  return l;
}
int main() {
  int i, j;
  cin >> n >> k;
  int ans1 = solve(1, n);
  int ans2 = solve(1, ans1 - 1);
  if (!ask(ans2, ans1)) ans2 = solve(ans1 + 1, n);
  cout << 2 << " " << ans1 << " " << ans2 << endl;
  return 0;
}
