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