#include <bits/stdc++.h>
using namespace std;
int n, k, ans;
string s;
int binary(int l, int r) {
  if (l > r) return -1;
  int ret = l;
  while (l < r) {
    int mid = (l + r) / 2;
    printf("1 %d %d\n", mid, mid + 1);
    fflush(stdout);
    cin >> s;
    if (s == "TAK")
      ret = r = mid;
    else
      ret = l = mid + 1;
  }
  return ret;
}
int main() {
  scanf("%d%d", &n, &k);
  int a1 = binary(1, n);
  int a2 = binary(1, a1 - 1);
  int a3 = binary(a1 + 1, n);
  if (a2 == -1) {
    printf("2 %d %d\n", a1, a3);
    return 0;
  }
  printf("1 %d %d\n", a2, a1);
  cin >> s;
  if (s == "TAK")
    printf("2 %d %d\n", a1, a2);
  else
    printf("2 %d %d\n", a1, a3);
  return 0;
}
