#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int k, n;
  cin >> n >> k;
  if (n == 2) return cout << 2 << ' ' << 1 << ' ' << 2 << endl, 0;
  int ans1, ans2;
  int l = 1, r = n;
  while (l < r) {
    int mid = (l + r) / 2;
    cout << 1 << ' ' << mid << ' ' << mid + 1 << endl;
    string s;
    cin >> s;
    if (s == "NIE")
      l = mid + 1;
    else
      r = mid;
  }
  ans1 = l;
  if (ans1 != n) {
    l = ans1 + 1, r = n;
    bool good = 0;
    while (l < r) {
      int mid = (l + r) / 2;
      cout << 1 << ' ' << mid << ' ' << mid + 1 << endl;
      string s;
      cin >> s;
      if (s == "NIE")
        l = mid + 1;
      else {
        r = mid;
      }
    }
    ans2 = r;
    cout << 1 << ' ' << ans2 << ' ' << ans1 << endl;
    string s;
    cin >> s;
    if (s != "NIE") return cout << 2 << ' ' << ans1 << ' ' << ans2 << endl, 0;
  }
  l = 1, r = ans1 - 1;
  while (l < r) {
    int mid = (l + r) / 2;
    cout << 1 << ' ' << mid << ' ' << mid + 1 << endl;
    string s;
    cin >> s;
    if (s == "NIE")
      l = mid + 1;
    else {
      r = mid;
    }
  }
  ans2 = r;
  cout << 2 << ' ' << ans1 << ' ' << ans2 << endl;
}
