#include <bits/stdc++.h>
using namespace std;
string ss[] = {"NIE", "TAK"};
void Send(int x, int y) { cout << "1 " << x << " " << y << endl; }
void Answer(int x, int y) {
  cout << "2 " << x << " " << y << endl;
  exit(0);
}
string Get() {
  string s;
  cin >> s;
  return s;
}
bool check(int l, int r) {
  Send(l, r);
  string s = Get();
  return (s == ss[1]);
}
int bs(int l, int r) {
  while (l < r) {
    int m = (l + r) >> 1;
    if (check(m, m + 1)) {
      r = m;
    } else {
      l = m + 1;
    }
  }
  return l;
}
void solve() {
  int n, k;
  cin >> n >> k;
  int ans1, ans2;
  ans1 = bs(1, n);
  if (ans1 > 1) {
    ans2 = bs(1, ans1 - 1);
    Send(ans2, ans1);
    string s = Get();
    if (s == ss[0]) {
      ans2 = bs(ans1 + 1, n);
    }
  } else {
    ans2 = bs(ans1 + 1, n);
  }
  Answer(ans1, ans2);
}
int main() {
  solve();
  return 0;
}
