#include <bits/stdc++.h>
using namespace std;
static const double PI = 2 * acos(0);
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N, K;
  cin >> N >> K;
  int lo = 1, hi = N;
  while (lo < hi) {
    int mid1 = (lo + hi) / 2;
    int mid2 = mid1 + 1;
    cout << 1 << " " << mid1 << " " << mid2 << endl;
    string input;
    cin >> input;
    if (input == "TAK")
      hi = mid1;
    else
      lo = mid2;
  }
  int firstv = lo, secv = -1;
  lo = 1, hi = firstv - 1;
  if (hi >= lo) {
    while (lo < hi) {
      int mid1 = (lo + hi) / 2;
      int mid2 = mid1 + 1;
      cout << 1 << " " << mid1 << " " << mid2 << endl;
      string input;
      cin >> input;
      if (input == "TAK")
        hi = mid1;
      else
        lo = mid2;
    }
    cout << 1 << " " << lo << " " << firstv << endl;
    string input;
    cin >> input;
    if (input == "TAK") secv = lo;
  }
  lo = firstv + 1, hi = N;
  if (hi >= lo && secv == -1) {
    while (lo < hi) {
      int mid1 = (lo + hi) / 2;
      int mid2 = mid1 + 1;
      cout << 1 << " " << mid1 << " " << mid2 << endl;
      string input;
      cin >> input;
      if (input == "TAK")
        hi = mid1;
      else
        lo = mid2;
    }
  }
  if (secv == -1) secv = lo;
  cout << 2 << " " << firstv << " " << secv << endl;
  return 0;
}
