#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500010;
const int mod = 1000000007;
int test(int l, int r) {
  while (l < r) {
    int mid = l + (r - l) / 2;
    cout << 1 << " " << mid << " " << mid + 1 << endl;
    string s;
    cin >> s;
    if (s == "TAK") {
      r = mid;
    } else {
      l = mid + 1;
    }
  }
  return l;
}
int main() {
  int n, k;
  cin >> n >> k;
  if (n == 2) {
    cout << "2 1 2" << endl;
    return 0;
  }
  int l = 1, r = n;
  int ans1 = test(l, r);
  int ans2 = test(ans1 + 1, r);
  if (ans2 == ans1 + 1) {
    int tmp = test(1, ans1 - 1);
    if (tmp != ans1 - 1 && tmp != ans1) {
      ans2 = tmp;
    } else if (ans1 == n)
      ans2 = n - 1;
    else if (ans1 == 1)
      ans2 = 2;
    else {
      cout << 1 << " " << ans1 - 1 << " " << ans1 + 1 << endl;
      string s;
      cin >> s;
      ans2 = (s == "TAK" ? ans1 - 1 : ans1 + 1);
    }
  }
  cout << 2 << " " << ans1 << " " << ans2 << endl;
}
