#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const long long maxn = 3e6;
const long long mod = 1e9 + 7;
const long double PI = acos((long double)-1);
long long pw(long long a, long long b, long long md = mod) {
  long long res = 1;
  while (b) {
    if (b & 1) {
      res = (a * res) % md;
    }
    a = (a * a) % md;
    b >>= 1;
  }
  return (res);
}
int n, k;
int ask(int x, int y) {
  if (x == 1e9) return (0);
  cout << 1 << ' ' << x << ' ' << y << endl;
  string ans;
  cin >> ans;
  return (ans == "TAK");
}
int find(int l, int r) {
  if (l > r) return (1e9);
  if (l == r) return (l);
  int mid = (l + r) / 2;
  if (ask(mid, mid + 1)) return (find(l, mid));
  return (find(mid + 1, r));
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  int ans1 = find(1, n);
  int ans2 = find(1, ans1 - 1);
  int ansyadaky = find(ans1 + 1, n);
  if (!ask(ans2, ans1)) ans2 = ansyadaky;
  cout << 2 << ' ' << ans1 << ' ' << ans2;
  return (0);
}
