#include <bits/stdc++.h>
using namespace std;
bool query(int x, int y) {
  cout << 1 << " " << x << " " << y << '\n';
  fflush(stdout);
  string s;
  cin >> s;
  return (s == "TAK");
}
void print(int a, int b) {
  cout << 2 << " " << a << " " << b << '\n';
  fflush(stdout);
}
int main() {
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  int lo = 1, up = n;
  while (lo < up) {
    int third = (up - lo) / 3;
    int mid1 = lo + third, mid2 = up - third;
    if (query(mid1, mid2))
      up = (mid1 + mid2) / 2;
    else
      lo = (mid1 + mid2 + 1) / 2;
  }
  int sol1 = lo;
  lo = sol1 + 1;
  up = n;
  while (lo < up) {
    int third = (up - lo) / 3;
    int mid1 = lo + third, mid2 = up - third;
    if (query(mid1, mid2))
      up = (mid1 + mid2) / 2;
    else
      lo = (mid1 + mid2 + 1) / 2;
  }
  int cand1 = lo;
  lo = 1, up = sol1 - 1;
  while (lo < up) {
    int third = (up - lo) / 3;
    int mid1 = lo + third, mid2 = up - third;
    if (query(mid1, mid2))
      up = (mid1 + mid2) / 2;
    else
      lo = (mid1 + mid2 + 1) / 2;
  }
  int cand2 = lo;
  if (sol1 == 1)
    print(sol1, cand1);
  else if (sol1 == n)
    print(sol1, cand2);
  else {
    if (query(cand1, cand2))
      print(sol1, cand1);
    else
      print(sol1, cand2);
  }
}
