#include <bits/stdc++.h>
using namespace std;
const int inf = 2000000000;
const long long infLL = 9000000000000000000;
template <typename first, typename second>
ostream& operator<<(ostream& os, const pair<first, second>& p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  os << "{";
  for (auto it = v.begin(); it != v.end(); ++it) {
    if (it != v.begin()) os << ", ";
    os << *it;
  }
  return os << "}";
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& v) {
  os << "[";
  for (auto it = v.begin(); it != v.end(); ++it) {
    if (it != v.begin()) os << ",";
    os << *it;
  }
  return os << "]";
}
template <typename T>
ostream& operator<<(ostream& os, const multiset<T>& v) {
  os << "[";
  for (auto it = v.begin(); it != v.end(); ++it) {
    if (it != v.begin()) os << ", ";
    os << *it;
  }
  return os << "]";
}
template <typename first, typename second>
ostream& operator<<(ostream& os, const map<first, second>& v) {
  os << "[";
  for (auto it = v.begin(); it != v.end(); ++it) {
    if (it != v.begin()) os << ", ";
    os << it->first << " = " << it->second;
  }
  return os << "]";
}
void faltu() { cerr << endl; }
template <typename T>
void faltu(T a[], int n) {
  for (int i = 0; i < n; ++i) cerr << a[i] << ' ';
  cerr << endl;
}
template <typename T, typename... hello>
void faltu(T arg, const hello&... rest) {
  cerr << arg << ' ';
  faltu(rest...);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, k;
  cin >> n >> k;
  int lo = 1, hi = n, mid;
  while (lo < hi) {
    mid = (lo + hi) / 2;
    cout << 1 << " " << mid << " " << mid + 1 << endl;
    string s;
    cin >> s;
    if (s == "TAK")
      hi = mid;
    else
      lo = mid + 1;
  }
  int x = lo;
  lo = x + 1, hi = n;
  while (lo < hi) {
    mid = (lo + hi) / 2;
    cout << 1 << " " << mid + 1 << " " << mid << endl;
    string s;
    cin >> s;
    if (s == "TAK")
      lo = mid + 1;
    else
      hi = mid;
  }
  int y1 = lo;
  lo = 1, hi = x - 1;
  while (lo < hi) {
    mid = (lo + hi) / 2;
    cout << 1 << " " << mid << " " << mid + 1 << endl;
    string s;
    cin >> s;
    if (s == "TAK")
      hi = mid;
    else
      lo = mid + 1;
  }
  int y2 = lo;
  int y;
  if (y1 == n + 1)
    y = y2;
  else {
    cout << 1 << " " << y1 << " " << y2 << endl;
    string s;
    cin >> s;
    if (s == "TAK")
      y = y1;
    else
      y = y2;
  }
  cout << 2 << " " << x << " " << y << endl;
  return 0;
}
