#include <bits/stdc++.h>
const int N = 1e5 + 5;
int n;
inline int read() {
  int now = 0;
  register char c = getchar();
  for (; !isdigit(c); c = getchar())
    ;
  for (; isdigit(c); now = now * 10 + c - '0', c = getchar())
    ;
  return now;
}
inline bool Query(int x, int y) {
  static char s[7];
  if (y > n) return 1;
  printf("1 %d %d\n", x, y);
  fflush(stdout);
  return scanf("%s", s), s[0] == 'T';
}
int Check(int l, int r) {
  if (l > r) return 0;
  int mid, ans = 0;
  while (l <= r)
    if (mid = l + r >> 1, Query(mid, mid + 1))
      ans = mid, r = mid - 1;
    else
      l = mid + 1;
  return ans;
}
int main() {
  n = read();
  int K = read();
  int A = Check(1, n), B = Check(1, A - 1);
  if (!B) B = Check(A + 1, n);
  printf("2 %d %d\n", A, B);
  fflush(stdout);
  return 0;
}
