#include <bits/stdc++.h>
using namespace std;
int n, k, ans1, ans2;
int query(int x, int y) {
  cout << 1 << ' ' << x << ' ' << y << endl;
  string q;
  cin >> q;
  if (q == "TAK")
    return 1;
  else
    return 0;
}
int solve1(int l, int r) {
  int mid, m1, m2;
  if (l == r) return l;
  if (l + 1 == r) {
    if (query(l, r))
      return l;
    else
      return r;
  }
  while (r - l >= 3) {
    mid = (l + r) / 2;
    m1 = l + (r - l) / 3;
    m2 = r - (r - l) / 3;
    if (query(m1, m2))
      r = mid;
    else
      l = mid + 1;
  }
  if (l + 1 == r) {
    if (query(l, r))
      return l;
    else
      return r;
  }
  if (query(l, l + 1))
    return l;
  else if (query(l + 1, l + 2))
    return l + 1;
  else
    return l + 2;
}
int solve2(int l, int r) {
  int mid, m1, m2;
  if (l > r) return -1;
  if (l == r) {
    if (query(1, 2))
      return 1;
    else
      return -1;
  }
  if (l + 1 == r) {
    if (query(2, 3))
      return 2;
    else
      return -1;
  }
  while (r - l >= 3) {
    mid = (l + r) / 2;
    m1 = l + (r - l) / 3;
    m2 = r - (r - l) / 3;
    if (query(m1, m2))
      r = mid;
    else
      l = mid + 1;
  }
  if (r == ans1 - 1 && !query(ans1 - 1, ans1)) return -1;
  if (query(l, l + 1))
    return l;
  else if (query(l + 1, l + 2))
    return l + 1;
  else
    return l + 2;
}
int main() {
  cin >> n >> k;
  if (n == 2) {
    cout << "2 1 2" << endl;
    return 0;
  }
  ans1 = solve1(1, n);
  if (solve2(1, ans1 - 1) == -1)
    ans2 = solve1(ans1 + 1, n);
  else
    ans2 = solve2(1, ans1 - 1);
  cout << 2 << ' ' << ans1 << ' ' << ans2 << "\n";
}
