#include <bits/stdc++.h>
using namespace std;
const int maxN = 2004;
int n, m;
int root;
int t[maxN];
int st[maxN], dr[maxN];
int sz[maxN];
vector<int> comp;
bool vis[maxN];
char ask(int a, int b, int c) {
  char ans[4];
  printf("%d %d %d\n", a, b, c);
  fflush(stdout);
  scanf("%s", ans);
  return ans[0];
}
void dfs(int nod, int tata) {
  comp.push_back(nod);
  if (!st[nod] && !dr[nod]) sz[nod] = 1;
  if (st[nod] && !vis[st[nod]]) {
    dfs(st[nod], nod);
    sz[nod] += sz[st[nod]];
  }
  if (dr[nod] && !vis[dr[nod]]) {
    dfs(dr[nod], nod);
    sz[nod] += sz[dr[nod]];
  }
}
void addNode(int x, int y, int z) {
  if (st[t[x]] == x)
    st[t[x]] = z;
  else
    dr[t[x]] = z;
  t[z] = t[x];
  t[x] = t[y] = z;
  st[z] = x;
  dr[z] = y;
}
void divideImpera(int root, int leaf) {
  comp.clear();
  memset(sz, 0, sizeof(sz));
  dfs(root, t[root]);
  int centroid = -1;
  for (auto it : comp)
    if (2 * sz[it] > sz[root] && (centroid == -1 || sz[it] < sz[centroid]))
      centroid = it;
  if (st[centroid] == 0 && dr[centroid] == 0)
    addNode(centroid, leaf, n + leaf);
  else {
    int lef = centroid;
    int rig = centroid;
    vis[centroid] = true;
    while (st[lef]) lef = st[lef];
    while (dr[rig]) rig = dr[rig];
    int res = ask(lef, leaf, rig);
    if (res == 'Z') {
      if (centroid == root)
        addNode(centroid, leaf, n + leaf);
      else
        divideImpera(root, leaf);
    } else if (res == 'Y') {
      if (vis[dr[centroid]])
        addNode(dr[centroid], leaf, n + leaf);
      else
        divideImpera(dr[centroid], leaf);
    } else {
      if (vis[st[centroid]])
        addNode(st[centroid], leaf, n + leaf);
      else
        divideImpera(st[centroid], leaf);
    }
  }
}
int main() {
  scanf("%d", &n);
  root = n;
  for (int i = 1; i < n; i++) {
    memset(vis, false, sizeof(vis));
    divideImpera(root, i);
    while (t[root] > 0) root = t[root];
  }
  printf("-1\n");
  for (int i = 1; i < 2 * n; i++) printf("%d ", t[i] == 0 ? -1 : t[i]);
  fflush(stdout);
  return 0;
}
