import std.stdio, std.string, std.conv, std.range;
import std.algorithm, std.array, std.typecons, std.container;
import std.math, std.numeric, std.random, core.bitop;

enum inf = 1_001_001_001;
enum infl = 1_001_001_001_001_001_001L;

enum mod = 1_000_000_007L;




void main() {
    writeln(-1);
}


struct LCA {
    int N, L, root;
    int[] depth;
    int[][] dp;

    this(int[][] adj, int root) {
        N = adj.length.to!int;
        while ((1 << L) <= N) L++;
        this.root = root;
        depth = new int[](N);
        dp = new int[][](N, L);
        dfs(adj, this.root, -1);

        foreach (i ; 1 .. L) {
            foreach (v ; 0 .. N) {
                if ((1 << i) > depth[v]) continue;
                dp[v][i] = dp[dp[v][i - 1]][i - 1];
            }
        }
    }

    void clear() {
        N = L = root = 0;
        depth.destroy();
        dp.destroy();
    }

    void dfs(int[][] adj, int v, int p) {
        dp[v][] = -1;
        dp[v][0] = p;
        depth[v] = (p == -1 ? 0 : depth[p] + 1);
        foreach (u ; adj[v]) if (u != p) {
            dfs(adj, u, v);
        }
    }

    int query(int u, int v) {
        if (depth[u] > depth[v]) swap(u, v);
        // depth[u] <= depth[v]
        int dif = depth[v] - depth[u];

        // v を引き上げて u と v の深さを揃える
        foreach_reverse (i ; 0 .. L) {
            if (dif & 1 << i) {
                v = dp[v][i];
            }
        }

        if (u == v) return u;

        // u と v を lca(u, v) の一つ下まで引き上げる
        foreach_reverse (i ; 0 .. L) {
            if (dp[u][i] != dp[v][i]) {
                u = dp[u][i];
                v = dp[v][i];
            }
        }

        return dp[u][0];
    }

    alias opCall = query;
}



void scan(T...)(ref T args) {
    auto line = readln.split;
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront;
    }
    assert(line.empty);
}

void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}

bool chmin(T, U...)(ref T x, U args) {
    bool isChanged;
    foreach (arg; args) if (x > arg) {
        x = arg;
        isChanged = true;
    }
    return isChanged;
}

bool chmax(T, U...)(ref T x, U args) {
    bool isChanged;
    foreach (arg; args) if (x < arg) {
        x = arg;
        isChanged = true;
    }
    return isChanged;
}

void yes(bool ok, string y = "Yes", string n = "No") {
    return writeln(ok ? y : n);
}
