#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
char str[105];
bool flag;
int cnt = 0, n;
int find(int L, int R) {
  while (L <= R) {
    int mid = (L + R) >> 1;
    if (mid < 0 || mid > n || mid + 1 < 0 || mid + 1 > n) {
      R = mid - 1;
      continue;
    }
    printf("1 %d %d\n", mid, mid + 1);
    fflush(stdout);
    scanf("%s", str);
    if (str[0] == 'N') {
      L = mid + 1;
    } else {
      flag = true;
      R = mid - 1;
    }
  }
  return L;
}
int main() {
  int k;
  scanf("%d%d", &n, &k);
  cnt = 1;
  int ans1 = find(1, n);
  flag = false;
  ++cnt;
  int ans2 = find(1, ans1 - 1);
  if (flag && ans2 <= n) {
    printf("2 %d %d\n", ans1, ans2);
  } else {
    ++cnt;
    ans2 = find(ans1 + 1, n);
    printf("2 %d %d\n", ans1, ans2);
  }
}
