#include <bits/stdc++.h>
using namespace std;
long long modpow(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) {
      ans = (ans * a) % 1000000007;
    }
    a = (a * a) % 1000000007;
    b = b / 2;
  }
  return ans;
}
int main() {
  int n, k;
  cin >> n >> k;
  if (n == 2) {
    cout << 2 << " " << 1 << " " << 2 << endl;
    fflush(stdout);
    return 0;
  }
  int lo = 1, hi = n, md1, md2;
  int ans = -1;
  int anss = -1;
  while (lo < hi) {
    md1 = (lo + hi) / 2;
    md2 = md1 + 1;
    cout << 1 << " " << md1 << " " << md2 << endl;
    fflush(stdout);
    string s;
    cin >> s;
    if (hi - lo == 1) {
      if (s[0] == 'T') {
        ans = md1;
      } else
        ans = md2;
      break;
    } else {
      if (s[0] == 'T') {
        hi = md1;
      } else {
        lo = md2;
      }
    }
    if (lo == hi) {
      ans = lo;
      break;
    }
  }
  if (ans == 1) {
    lo = 2;
    hi = n;
    while (lo < hi) {
      md1 = (lo + hi) / 2;
      md2 = md1 + 1;
      cout << 1 << " " << md1 << " " << md2 << endl;
      fflush(stdout);
      string s;
      cin >> s;
      if (hi - lo == 1) {
        if (s[0] == 'T') {
          anss = md1;
        } else
          anss = md2;
        break;
      } else {
        if (s[0] == 'T') {
          hi = md1;
        } else {
          lo = md2;
        }
      }
      if (lo == hi) {
        anss = lo;
        break;
      }
    }
  } else if (ans == n) {
    lo = 1;
    hi = n - 1;
    while (lo < hi) {
      md1 = (lo + hi) / 2;
      md2 = md1 + 1;
      cout << 1 << " " << md1 << " " << md2 << endl;
      fflush(stdout);
      string s;
      cin >> s;
      if (hi - lo == 1) {
        if (s[0] == 'T') {
          anss = md1;
        } else
          anss = md2;
        break;
      } else {
        if (s[0] == 'T') {
          hi = md1;
        } else {
          lo = md2;
        }
      }
      if (lo == hi) {
        anss = lo;
        break;
      }
    }
  } else {
    int lo1 = 1, hi1 = ans - 1;
    int lo2 = ans + 1, hi2 = n;
    if (lo1 == hi1) {
      cout << 1 << " " << lo1 << " " << ans << endl;
      fflush(stdout);
      string s;
      cin >> s;
      if (s[0] == 'T') {
        anss = lo1;
        goto xx;
      }
    }
    if (lo2 == hi2) {
      cout << 1 << " " << lo2 << " " << ans << endl;
      fflush(stdout);
      string s;
      cin >> s;
      if (s[0] == 'T') {
        anss = lo2;
        goto xx;
      }
    }
    while (lo1 < hi1) {
      md1 = (lo1 + hi1) / 2;
      md2 = md1 + 1;
      cout << 1 << " " << md1 << " " << md2 << endl;
      fflush(stdout);
      string s;
      cin >> s;
      if (hi1 - lo1 == 1) {
        if (s[0] == 'T') {
          anss = md1;
        } else
          anss = md2;
        break;
      } else {
        if (s[0] == 'T') {
          hi1 = md1;
        } else {
          lo1 = md2;
        }
      }
      if (lo1 == hi1) {
        anss = lo1;
        break;
      }
    }
    if (anss == ans - 1) {
      cout << 1 << " " << anss << " " << ans << endl;
      fflush(stdout);
      string s;
      cin >> s;
      if (s[0] == 'T') {
        goto xx;
      }
    } else if (anss != -1) {
      goto xx;
    }
    while (lo2 < hi2) {
      md1 = (lo2 + hi2) / 2;
      md2 = md1 + 1;
      cout << 1 << " " << md1 << " " << md2 << endl;
      fflush(stdout);
      string s;
      cin >> s;
      if (hi2 - lo2 == 1) {
        if (s[0] == 'T') {
          anss = md1;
        } else
          anss = md2;
        break;
      } else {
        if (s[0] == 'T') {
          hi2 = md1;
        } else {
          lo2 = md2;
        }
      }
      if (lo2 == hi2) {
        anss = lo2;
        break;
      }
    }
  }
xx:
  cout << 2 << " " << ans << " " << anss << endl;
  fflush(stdout);
  return 0;
}
