#include<bits/stdc++.h>
using namespace std;
#define X first
#define Y second
#define eps 1e-2
#define gcd __gcd
#define pb push_back
#define PI acos(-1.0)
#define lowbit(x) (x)&(-x)
#define bug printf("!!!!!\n");
#define mem(x,y) memset(x,y,sizeof(x))
typedef long long LL;
typedef long double LD;
typedef pair<int,int> pii;
typedef unsigned long long uLL;
const int maxn = 1e5+2;
const int INF = 1<<30;
const int mod = 1e9+7;
bool check(int x,int y){
cout<<"1 "<<x<<" "<<y<<endl;
fflush(stdout);
string s;cin>>s;
return s[0]=='T';
}
int by(int l,int r){
while(l<r){
int mid=(l+r)>>1;
if(check(mid,mid+1)) r=mid;
else l=mid+1;
}
return l;
}
void solve(){
int n,k;cin>>n>>k;
int x=by(1,n);
int y=by(1,x-1);
if(x==y||check(y,x)==0) y=by(x+1,n);
cout<<2<<" "<<x<<" "<<y<<endl;
return;
}
int main()
{
int t = 1;
while(t--){
solve();
}
return 0;
}