#include <bits/stdc++.h>
using namespace std;
int n, k;
bool check(int x, int y) {
  printf("1 %d %d\n", x, y);
  fflush(stdout);
  char s[10];
  scanf("%s", s);
  if (!strcmp(s, "TAK"))
    return true;
  else
    return false;
}
int Erfen(int L, int R) {
  int l = L, r = R;
  while (l < r) {
    int mid = (l + r) >> 1;
    if (check(mid, mid + 1))
      r = mid;
    else
      l = mid + 1;
  }
  return l;
}
int main() {
  scanf("%d%d", &n, &k);
  int ansx = Erfen(1, n);
  int ansy = Erfen(1, ansx - 1);
  if (check(ansy, ansx) == false || ansx == ansy) ansy = Erfen(ansx + 1, n);
  printf("2 %d %d\n", ansx, ansy);
  return 0;
}
