#include <bits/stdc++.h>
using namespace std;
int n, m, ans1, ans2;
char s[10];
bool check(int x) {
  if (x > 1) {
    printf("1 %d %d\n", x, x - 1);
    fflush(stdout);
    scanf("%s", s + 1);
    if (s[1] == 'N') return 0;
  }
  if (x < n) {
    printf("1 %d %d\n", x, x + 1);
    fflush(stdout);
    scanf("%s", s + 1);
    if (s[1] == 'N') return 0;
  }
  return 1;
}
int main() {
  scanf("%d%d", &n, &m);
  int l = 1, r = n;
  while (l <= r) {
    if (l == r) {
      ans1 = l;
      break;
    }
    int mid = (l + r) / 2;
    printf("1 %d %d\n", mid, mid + 1);
    fflush(stdout);
    scanf("%s", s + 1);
    if (s[1] == 'N')
      l = mid + 1;
    else
      r = mid;
  }
  if (ans1 < n) {
    l = ans1 + 1;
    r = n;
    while (l <= r) {
      if (l == r) {
        ans2 = l;
        break;
      }
      int mid = (l + r) / 2;
      printf("1 %d %d\n", mid + 1, mid);
      fflush(stdout);
      scanf("%s", s + 1);
      if (s[1] == 'N')
        r = mid;
      else
        l = mid + 1;
    }
    if (ans2 == ans1 + 1 && check(ans2) == 0) ans2 = 0;
  }
  if (ans2 == 0) {
    l = 1;
    r = ans1 - 1;
    while (l <= r) {
      if (l == r) {
        ans2 = l;
        break;
      }
      int mid = (l + r) / 2;
      printf("1 %d %d\n", mid, mid + 1);
      fflush(stdout);
      scanf("%s", s + 1);
      if (s[1] == 'N')
        l = mid + 1;
      else
        r = mid;
    }
  }
  printf("2 %d %d\n", ans1, ans2);
  fflush(stdout);
  return 0;
}
