#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long n, k;
long long f;
long long cnt = 0;
bool check(int x, int y) {
  if (x > n) return false;
  cout << 1 << " " << x << " " << y << endl;
  string ss;
  cin >> ss;
  return ss == "TAK";
}
bool closeronleft(int x) {
  cnt++;
  if (x == n) return true;
  return check(x, x + 1);
}
long long getfirst(long long l = 1, long long h = n) {
  while (l < h) {
    long long mid = (l + h) / 2;
    if (closeronleft(mid)) {
      h = mid;
    } else {
      l = mid + 1;
    }
  }
  return l;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  f = getfirst();
  long long g = getfirst(f + 1, n);
  if (check(g, f)) {
    return cout << 2 << " " << f << " " << g << endl, 0;
  }
  g = getfirst(1, f - 1);
  if (check(g, f)) {
    return cout << 2 << " " << f << " " << g << endl, 0;
  }
  return cout << 2 << " " << f << " " << f + 1 << endl, 0;
  return 0;
}
