#include <bits/stdc++.h>
int N, fa[2001], ls[2001], rs[2001], del[2001];
char query(int x, int y, int z) {
  printf("%d %d %d\n", x, y, z);
  fflush(stdout);
  char s[3];
  scanf("%s", s);
  return s[0];
}
int Cat(int p) {
  static int q[2001], f[2001], size[2001], mxson[2001];
  int H = 0, T = 1;
  q[1] = p;
  f[p] = 0;
  while (H < T) {
    int u = q[++H];
    std::vector<int> nxt = {ls[u], rs[u], fa[u]};
    for (int v : nxt)
      if (v > N && !del[v] && v != f[u]) f[q[++T] = v] = u;
  }
  for (int i = 1; i <= T; i++) {
    size[q[i]] = 1;
    mxson[q[i]] = 0;
  }
  for (int i = T; i; i--) {
    if (size[q[i]] << 1 >= T && mxson[q[i]] << 1 <= T) return q[i];
    size[f[q[i]]] += size[q[i]];
    if (size[q[i]] > mxson[f[q[i]]]) mxson[f[q[i]]] = size[q[i]];
  }
  return 0;
}
int Bear(int i, int p) {
  p = Cat(p);
  del[p] = 1;
  int L = ls[p], R = rs[p];
  while (L > N) L = ls[L];
  while (R > N) R = ls[R];
  char x = query(L, R, i);
  if (x == 'X') {
    if (fa[p] == 0 || del[fa[p]]) return p;
    return Bear(i, fa[p]);
  } else if (x == 'Y') {
    if (rs[p] <= N || del[rs[p]])
      return rs[p];
    else
      return Bear(i, rs[p]);
  } else {
    if (ls[p] <= N || del[ls[p]])
      return ls[p];
    else
      return Bear(i, ls[p]);
  }
}
int main() {
  scanf("%d", &N);
  ls[N + 1] = 1;
  rs[N + 1] = 2;
  fa[1] = fa[2] = N + 1;
  for (int i = 3; i <= N; i++) {
    for (int j = N + 1; j <= N + i - 2; j++) del[j] = 0;
    int pos = Bear(i, N + 1);
    int newnode = N + i - 1;
    fa[newnode] = fa[pos];
    if (fa[pos] && ls[fa[pos]] == pos) {
      ls[fa[pos]] = newnode;
      ls[newnode] = pos;
      rs[newnode] = i;
    } else {
      rs[fa[pos]] = newnode;
      ls[newnode] = i;
      rs[newnode] = pos;
    }
    fa[i] = fa[pos] = newnode;
  }
  puts("-1");
  for (int i = 1; i <= N + N - 1; i++)
    printf("%d%c", fa[i] ? fa[i] : -1, " \n"[i == N + N - 1]);
  fflush(stdout);
  return 0;
}
