#include <bits/stdc++.h>
using namespace std;
using i8 = int8_t;
using i16 = int16_t;
using i32 = int32_t;
using i64 = int64_t;
using isize = ptrdiff_t;
using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;
using usize = size_t;
using f32 = float_t;
using f64 = double_t;
template <typename T>
using vec = vector<T>;
mt19937 rng(chrono::system_clock::now().time_since_epoch().count());
template <typename T>
using min_heap = priority_queue<T, vec<T>, greater<T>>;
auto main() -> i32 {
  i64 n, k;
  cin >> n >> k;
  i64 p;
  {
    i64 ok = 1;
    i64 ng = n;
    while (ng - ok > 0) {
      i64 mid = (ok + ng) / 2;
      cout << "1 " << mid << " " << mid + 1 << "\n";
      string s;
      cin >> s;
      if (s == "TAK") {
        ng = mid;
      } else {
        ok = mid + 1;
      }
    }
    p = ok;
  }
  {
    i64 sp = -1;
    if (p != 1) {
      i64 ok = 1;
      i64 ng = p - 1;
      while (ng - ok > 0) {
        i64 mid = (ok + ng) / 2;
        cout << "1 " << mid << " " << mid + 1 << "\n";
        string s;
        cin >> s;
        if (s == "TAK") {
          ng = mid;
        } else {
          ok = mid + 1;
        }
      }
      sp = ok;
    }
    if (sp != -1) {
      cout << "1 " << sp << " " << p << "\n";
      string s;
      cin >> s;
      if (s == "TAK") {
        cout << "2 " << sp << " " << p << "\n";
        return 0;
      }
    }
    i64 ok = p + 1;
    i64 ng = n;
    while (ng - ok > 0) {
      i64 mid = (ok + ng) / 2;
      cout << "1 " << mid << " " << mid + 1 << "\n";
      string s;
      cin >> s;
      if (s == "TAK") {
        ng = mid;
      } else {
        ok = mid + 1;
      }
    }
    sp = ok;
    cout << "2 " << sp << " " << p << "\n";
    return 0;
  }
  return 0;
}
