#include <bits/stdc++.h>
using namespace std;
long long n, k, l, r, x, y, p1, p2;
string s;
int main() {
  cin >> n >> k;
  if (n == k) {
    cout << "2 1 2\n";
    cout.flush();
    return 0;
  }
  l = 1, r = n;
  while (l < r) {
    x = (l + r) / 2, y = x + 1;
    cout << "1 " << x << " " << y << endl;
    cout.flush();
    cin >> s;
    if (s == "TAK")
      r = x;
    else
      l = y;
  }
  p1 = l;
  if (p1 > 1)
    l = 1, r = p1 - 1;
  else
    l = p1 + 1, r = n;
  while (l < r) {
    x = (l + r) / 2, y = x + 1;
    cout << "1 " << x << " " << y << endl;
    cout.flush();
    cin >> s;
    if (s == "TAK")
      r = x;
    else
      l = y;
  }
  cout << "1 " << l << " " << p1 << endl;
  cout.flush();
  cin >> s;
  if (s == "TAK")
    p2 = l;
  else
    l = p1 + 1, r = n;
  if (p2 > 0) {
    cout << "2 " << p1 << " " << p2 << endl;
    cout.flush();
    return 0;
  }
  while (l < r) {
    x = (l + r) / 2, y = x + 1;
    cout << "1 " << x << " " << y << endl;
    cout.flush();
    cin >> s;
    if (s == "TAK")
      r = x;
    else
      l = y;
  }
  cout << "2 " << p1 << " " << l;
  cout.flush();
}
