#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  return (a ? gcd(b % a, a) : b);
}
long long int modPow(long long int x, long long int n, long long int MOD) {
  long long int res = 1;
  while (n > 0) {
    if (n % 2 == 1) {
      res = (res * x) % MOD;
    }
    n /= 2;
    x = (x * x) % MOD;
  }
  return res;
}
long long int modInverse(long long int a, long long int p) {
  return modPow(a, p - 2, p);
}
int main() {
  ios_base::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  int lo = 1, hi = n, mid;
  while (lo < hi) {
    mid = lo + hi >> 1;
    cout << "1 " << mid << " " << mid + 1 << endl;
    fflush(stdout);
    string str;
    cin >> str;
    if (str == "TAK") {
      hi = mid;
    } else {
      lo = mid + 1;
    }
  }
  int one = lo;
  lo = 1, hi = one - 1;
  while (lo < hi) {
    mid = lo + hi >> 1;
    cout << "1 " << mid << " " << mid + 1 << endl;
    fflush(stdout);
    string str;
    cin >> str;
    if (str == "TAK") {
      hi = mid;
    } else {
      lo = mid + 1;
    }
  }
  int two = lo;
  if (two >= 1 && two <= n && two != one) {
    cout << "1 " << two << " " << one << endl;
    fflush(stdout);
    string str;
    cin >> str;
    if (str == "TAK") {
      cout << "2"
           << " " << one << " " << two;
      fflush(stdout);
      return 0;
    }
  }
  lo = one + 1, hi = n;
  while (lo < hi) {
    mid = lo + hi >> 1;
    cout << "1 " << mid << " " << mid + 1 << endl;
    fflush(stdout);
    string str;
    cin >> str;
    if (str == "TAK") {
      hi = mid;
    } else {
      lo = mid + 1;
    }
  }
  two = lo;
  cout << "2"
       << " " << one << " " << two;
  fflush(stdout);
}
