#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 10;
int gi() {
  int x = 0, o = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') o = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x * o;
}
int n, fa[N], tt, now, rt, siz[N], c, mx, mn, all;
vector<int> E[N];
bool vis[N];
int query(int x, int y, int z) {
  cout << x << ' ' << y << ' ' << z << endl;
  static char s[6];
  scanf("%s", s);
  return s[0] - 'X';
}
void dfs(int u, int fa) {
  siz[u] = 1;
  int mx = 0;
  for (auto v : E[u])
    if (v != fa && !vis[v]) {
      dfs(v, u);
      siz[u] += siz[v];
      mx = max(mx, siz[v]);
    }
  mx = max(mx, all - siz[u]);
  if (mx < mn || (mx == mn && u > c)) mn = mx, c = u;
}
int get_leaf(int u, int fa) {
  int ret = u;
  for (auto v : E[u])
    if (v != fa) ret = min(ret, get_leaf(v, u));
  return ret;
}
void solve(int u) {
  dfs(u, 0);
  all = siz[u];
  mn = 1e9;
  dfs(u, 0);
  int uu = u;
  vis[u = c] = 1;
  if (E[u].empty()) {
    ++tt;
    fa[tt] = fa[u];
    fa[u] = fa[now] = tt;
    return;
  }
  int p = get_leaf(E[u][0], u), q = get_leaf(E[u][1], u);
  int ret = query(p, now, q);
  if (ret == 2) {
    if (uu == c) {
      ++tt;
      fa[tt] = fa[u];
      fa[u] = fa[now] = tt;
      return;
    }
    solve(uu);
  } else if (vis[E[u][ret]]) {
    ++tt;
    fa[tt] = u;
    fa[E[u][ret]] = fa[now] = tt;
    return;
  } else
    solve(E[u][ret]);
}
int main() {
  cin >> n;
  tt = n;
  ++tt;
  fa[1] = fa[2] = tt;
  for (now = 3; now <= n; now++) {
    memset(vis, 0, sizeof(vis));
    for (int i = 1; i <= tt; i++) E[i].clear();
    for (int i = 1; i <= tt; i++) {
      if (now <= i && i <= n) continue;
      if (fa[i])
        E[fa[i]].push_back(i);
      else
        rt = i;
    }
    solve(rt);
  }
  cout << "-1" << endl;
  for (int i = 1; i <= tt; i++) {
    if (fa[i])
      cout << fa[i] << ' ';
    else
      cout << -1 << ' ';
  }
  cout << endl;
  return 0;
}
