#include <bits/stdc++.h>
using ll = long long;
using ld = long double;
using namespace std;
int n, k;
bool ask(int x, int y) {
  cout << 1 << " " << x << " " << y << endl;
  cout.flush();
  string s;
  cin >> s;
  return (s == "TAK");
}
int found = -1;
int find(int l, int r) {
  if (l > r) return -1;
  if (l == r) {
    if (found == -1) return l;
    if (ask(l, found)) return l;
    return -1;
  }
  int x = (l + r) / 2;
  if (ask(x, x + 1)) {
    return find(l, x);
  } else
    return find(x + 1, r);
}
int main() {
  ios_base::sync_with_stdio(false);
  cout.setf(ios::fixed);
  cout.precision(20);
  cin >> n >> k;
  int x = find(1, n);
  found = x;
  int y = find(1, x - 1);
  if (y == -1) y = find(x + 1, n);
  cout << 2 << " " << x << " " << y << endl;
  return 0;
}
