Problem: One day Vasya came up to the blackboard and wrote out n distinct integers from 1 to n in some order in a circle. Then he drew arcs to join the pairs of integers (a, b) (a ≠ b), that are either each other's immediate neighbors in the circle, or there is number c, such that a and с are immediate neighbors, and b and c are immediate neighbors. As you can easily deduce, in the end Vasya drew 2·n arcs.

For example, if the numbers are written in the circle in the order 1, 2, 3, 4, 5 (in the clockwise direction), then the arcs will join pairs of integers (1, 2), (2, 3), (3, 4), (4, 5), (5, 1), (1, 3), (2, 4), (3, 5), (4, 1) and (5, 2).

Much time has passed ever since, the numbers we wiped off the blackboard long ago, but recently Vasya has found a piece of paper with 2·n written pairs of integers that were joined with the arcs on the board. Vasya asks you to find the order of numbers in the circle by these pairs.

Input

The first line of the input contains a single integer n (5 ≤ n ≤ 105) that shows, how many numbers were written on the board. Next 2·n lines contain pairs of integers ai, bi (1 ≤ ai, bi ≤ n, ai ≠ bi) — the numbers that were connected by the arcs.

It is guaranteed that no pair of integers, connected by a arc, occurs in the input more than once. The pairs of numbers and the numbers in the pairs are given in the arbitrary order.

Output

If Vasya made a mistake somewhere and there isn't any way to place numbers from 1 to n on the circle according to the statement, then print a single number "-1" (without the quotes). Otherwise, print any suitable sequence of n distinct integers from 1 to n. 

If there are multiple solutions, you are allowed to print any of them. Specifically, it doesn't matter which number you write first to describe the sequence of the order. It also doesn't matter whether you write out the numbers in the clockwise or counter-clockwise direction.

Examples

Input

5
1 2
2 3
3 4
4 5
5 1
1 3
2 4
3 5
4 1
5 2


Output

1 2 3 4 5 

Input

6
5 6
4 3
5 3
2 4
6 1
3 1
6 2
2 5
1 4
3 6
1 2
4 5


Output

1 2 4 5 3 6 

Solution (in JAVA):

Solution:
import java.io.*;
import java.util.*;

public class C implements Runnable {

    private static final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;

    private BufferedReader in;
    private PrintWriter out;
    private StringTokenizer tok = new StringTokenizer("");

    private void init() throws FileNotFoundException {
        Locale.setDefault(Locale.US);
        String fileName = "";
        if (ONLINE_JUDGE && fileName.isEmpty()) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        } else {
            if (fileName.isEmpty()) {
                in = new BufferedReader(new FileReader("input.txt"));
                out = new PrintWriter("output.txt");
            } else {
                in = new BufferedReader(new FileReader(fileName + ".in"));
                out = new PrintWriter(fileName + ".out");
            }
        }
    }

    String readString() {
        while (!tok.hasMoreTokens()) {
            try {
                tok = new StringTokenizer(in.readLine());
            } catch (Exception e) {
                return null;
            }
        }
        return tok.nextToken();
    }

    int readInt() {
        return Integer.parseInt(readString());
    }

    long readLong() {
        return Long.parseLong(readString());
    }

    double readDouble() {
        return Double.parseDouble(readString());
    }

    int[] readIntArray(int size) {
        int[] a = new int[size];
        for (int i = 0; i < size; i++) {
            a[i] = readInt();
        }
        return a;
    }

    public static void main(String[] args) {
        //new Thread(null, new _Solution(), "", 128 * (1L << 20)).start();
        new C().run();
    }

    long timeBegin, timeEnd;

    void time() {
        timeEnd = System.currentTimeMillis();
        System.err.println("Time = " + (timeEnd - timeBegin));
    }

    @Override
    public void run() {
        try {
            timeBegin = System.currentTimeMillis();
            init();
            solve();
            out.close();
            time();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }

    private void solve() {
        int n = readInt();
        if (n <= 6) {
            stupidSolution(n);
            return;
        }

        List<Integer>[] graph = new List[n];
        for (int i = 0; i < n; i++) {
            graph[i] = new ArrayList<>(4);
        }
        for (int i = 0; i < 2 * n; i++) {
            int x = readInt() - 1;
            int y = readInt() - 1;
            graph[x].add(y);
            graph[y].add(x);
        }

        boolean[] used = new boolean[n];
        List<Integer> answer = new ArrayList<>();
        answer.add(0);
        used[0] = true;

        int next = 0;
        while (answer.size() < n) {
            Set<Integer> set = new HashSet<>();
            for (int to : graph[next]) {
                set.add(to);
            }
            boolean founded = false;
            for (int to : set) {
                int q = 0;
                for (int toto : graph[to]) {
                    if (set.contains(toto)) {
                        q++;
                    }
                }
                if (q == 2 && !used[to]) {
                    used[to] = true;
                    answer.add(next = to);
                    founded = true;
                    break;
                }
            }
            if (founded) {
                continue;
            }

            out.println(-1);
            return;
        }
        for (int x : answer) {
            out.print(x + 1 + " ");
        }
    }

    private void stupidSolution(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = i + 1;
        }
        permutate(a, 0, n);
        List<Pair> pairs = new ArrayList<>();
        for (int i = 0; i < 2 * n; i++) {
            int x = readInt();
            int y = readInt();
            pairs.add(new Pair(x, y));
        }
        Collections.sort(pairs);
        for (int[] permutation : permutations) {
            List<Pair> thisPairs = new ArrayList<>();
            for (int i = 0; i < n; i++) {
                add(permutation, thisPairs, i, i + 1, n);
                add(permutation, thisPairs, i, i + 2, n);
                add(permutation, thisPairs, i, i - 1, n);
                add(permutation, thisPairs, i, i - 2, n);
            }
            Collections.sort(thisPairs);
            boolean equal = true;
            for (int i = 0; i < 2 * n; i++) {
                equal &= pairs.get(i).compareTo(thisPairs.get(i)) == 0;
            }
            if (equal) {
                for (int i = 0; i < n; i++) {
                    out.print(permutation[i] + " ");
                }
                return;
            }
        }
        out.println(-1);
    }

    class Pair implements Comparable<Pair>{
        int x, y;

        public Pair(int x, int y) {
            this.x = Math.min(x, y);
            this.y = Math.max(x, y);
        }

        @Override
        public int compareTo(Pair o) {
            if (x == o.x) return Integer.compare(y, o.y);
            return Integer.compare(x, o.x);
        }
    }

    void add(int[] permutation, List<Pair> list, int index, int to, int n) {
        to = (to + n) % n;
        if (permutation[index] < permutation[to]) {
            list.add(new Pair(permutation[index], permutation[to]));
        }
    }

    List<int[]> permutations = new ArrayList<>();

    void permutate(int[] a, int i, int n) {
        if (i == n) {
            permutations.add(a.clone());
            return;
        }
        for (int j = 0; j <= i; j++) {
            int swap = a[i];
            a[i] = a[j];
            a[j] = swap;
            permutate(a, i + 1, n);
            swap = a[i];
            a[i] = a[j];
            a[j] = swap;
        }
    }
}