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:
/**
 * Created with IntelliJ IDEA.
 * User: yuantian
 * Date: 3/3/13
 * Time: 10:57 PM
 * To change this template use File | Settings | File Templates.
 */
import java.util.*;

public class CircleOfNumbers {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[][] arcs = new int[n][5];

        for(int i = 1; i <= 2*n; i++) {
            int from = in.nextInt()-1;
            int to = in.nextInt()-1;
            if(arcs[from][0] >= 4 || arcs[to][0] >= 4) {
                System.out.println(-1);
                return;
            }
            arcs[from][++arcs[from][0]] = to;
            arcs[to][++arcs[to][0]] = from;
        }

        for(int[] a :arcs) {
            if(a[0] != 4) {
                System.out.println(-1);
                return;
            }
            a[0] = 0;
            Arrays.sort(a);
        }

        if(n == 5) {
            System.out.println("1 2 3 4 5");
            return;
        }

        int[] res = new int[n];
        int[] next2 = findNext2(arcs);
        if(next2 == null) {
            System.out.println(-1); return;
        }

        int index = 0;
        res[++index] = next2[0];
        res[++index] = next2[1];
        arcs[0][0] = 1;
        arcs[next2[0]][0] = 1;
        arcs[next2[1]][0] = 1;

        int pre1 = next2[0], pre2 = next2[1];
        while(index < n-1) {
            int x = findNext(arcs, pre1, pre2);
            if(x == -1) {
                System.out.println(-1);
                return;
            }
            res[++index] = x;
            arcs[x][0] = 1;
            pre1 = pre2;
            pre2 = x;
        }

        StringBuilder sb = new StringBuilder();
        for(int i : res)
            sb.append(" ").append(i+1);
        System.out.println(sb.substring(1));
    }

    static int findNext(int[][] arcs, int pre, int pre1) {
        int a = 1, b = 1;
        int count = 0;
        int next = -1;
        while(a <= 4 && b <= 4) {
            if(arcs[pre][a] == arcs[pre1][b]) {
                if(arcs[arcs[pre][a]][0] != 1) {
                    count++;
                    next = arcs[pre][a];
                }
                a++; b++;
            } else if(arcs[pre][a] > arcs[pre1][b]) {
                b++;
            } else
                a++;
        }
        if(count == 1)
            return next;
        return -1;
    }

    static int[] findNext2(int[][] arcs) {
        int last = -1;
        for(int j = 1; j <= 4; j++) {
            int i = arcs[0][j];
            int count = 0;

            int a = 1, b = 1;
            while(a <= 4 && b <= 4) {
                if(arcs[0][a] == arcs[i][b]) {
                    last = arcs[0][a];
                    count++;
                    a++; b++;
                } else if (arcs[0][a] < arcs[i][b])
                    a++;
                else
                    b++;
            }

            if(count == 1 || (count == 2 && arcs.length == 6)) {
                int[] ret = new int[2];
                ret[0] = last;
                ret[1] = i;
                return ret;
            }
            if(count != 2)
                break;
        }
        return null;
    }
}