#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char *name, Arg1 &&arg1) {
  cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Args &&...args) {
  const char *comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
int n, k;
int fun(int lo, int hi) {
  while (lo < hi) {
    int mid = (lo + hi) / 2;
    printf("1 %d %d\n", mid, mid + 1);
    fflush(stdout);
    char s[4];
    scanf("%s", s);
    string s1 = s;
    if (s1 == "TAK") {
      hi = mid;
    } else
      lo = mid + 1;
  }
  return lo;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  scanf("%d%d", &n, &k);
  int ans1 = fun(1, n), ans;
  int ans2 = -1, ans3 = -1;
  if (ans1 > 1) {
    ans2 = fun(1, ans1 - 1);
  }
  if (ans1 < n) {
    ans3 = fun(ans1 + 1, n);
  }
  if (ans2 == -1)
    ans = ans3;
  else if (ans3 == -1)
    ans = ans2;
  else {
    printf("1 %d %d\n", ans2, ans1);
    fflush(stdout);
    char s[4];
    scanf("%s", s);
    string s1 = s;
    if (s1 == "TAK")
      ans = ans2;
    else
      ans = ans3;
  }
  printf("2 %d %d\n", ans1, ans);
  fflush(stdout);
  return 0;
}
