#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
template <class T, class U>
inline void Max(T &a, U b) {
  if (a < b) a = b;
}
template <class T, class U>
inline void Min(T &a, U b) {
  if (a > b) a = b;
}
inline void add(int &a, int b) {
  a += b;
  while (a >= 1000000007) a -= 1000000007;
}
int pow(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = ans * (long long)a % 1000000007;
    a = (long long)a * a % 1000000007;
    b >>= 1;
  }
  return ans;
}
string s;
int get(int first, int second) {
  cout << 1 << " " << first << " " << second << "\n";
  fflush(stdout);
  cin >> s;
  return s == "TAK" ? 1 : 0;
}
int first, second;
int solve(int l, int r) {
  if (l > r) return 0;
  if (l == r) {
    if (first == 0) {
      first = l;
      return 1;
    }
    int k = get(l, first);
    if (k == 0) return 0;
    second = l;
    return 1;
  }
  int m = (l + r) >> 1;
  int k = get(m, m + 1);
  if (k == 1) return solve(l, m);
  return solve(m + 1, r);
}
int main() {
  int T, i, j, k, ca = 0, m, K, n;
  scanf("%d%d", &n, &K);
  solve(1, n);
  k = solve(1, first - 1);
  if (k == 0) solve(first + 1, n);
  cout << 2 << " " << first << " " << second << "\n";
  return 0;
}
