#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10;
int n, k;
char ch[10];
int main() {
  cin >> n >> k;
  int l = 1, r = n;
  while (l < r) {
    int mid = l + r >> 1;
    cout << 1 << " " << mid << " " << mid + 1 << endl;
    fflush(stdout);
    scanf("%s", ch + 1);
    if (ch[1] == 'T')
      r = mid;
    else
      l = mid + 1;
  }
  int ans1 = l;
  l = 1, r = ans1 - 1;
  while (l < r) {
    int mid = l + r >> 1;
    cout << 1 << " " << mid << " " << mid + 1 << endl;
    fflush(stdout);
    scanf("%s", ch + 1);
    if (ch[1] == 'T')
      r = mid;
    else
      l = mid + 1;
  }
  cout << 1 << " " << l << " " << ans1 << endl;
  fflush(stdout);
  scanf("%s", ch + 1);
  if (ch[1] == 'T' && r != 0) {
    cout << 2 << " " << ans1 << " " << l << endl;
  } else {
    l = ans1 + 1, r = n;
    while (l < r) {
      int mid = l + r >> 1;
      cout << 1 << " " << mid << " " << mid + 1 << endl;
      fflush(stdout);
      scanf("%s", ch + 1);
      if (ch[1] == 'T')
        r = mid;
      else
        l = mid + 1;
    }
    cout << 2 << " " << ans1 << " " << l << endl;
  }
}
