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.OutputStreamWriter;
import java.io.BufferedWriter;
import java.io.PrintStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Random;
import java.io.Writer;
import java.util.Collection;
import java.io.IOException;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.ArrayList;
import java.util.NoSuchElementException;
import java.util.TreeSet;
import java.math.BigInteger;
import java.util.Collections;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author ogiekako
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		MyScanner in = new MyScanner(inputStream);
		MyPrintWriter out = new MyPrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {
    public void solve(int testNumber, MyScanner in, MyPrintWriter out) {
        int n = in.nextInt();
        ArrayList<Integer>[] es = new ArrayList[n];
        for (int i = 0; i < n; i++)
            es[i] = new ArrayList<Integer>();
        for (int i = 0; i < n * 2; i++) {
            int x = in.nextInt() - 1, y = in.nextInt() - 1;
            es[x].add(y); es[y].add(x);
        }
        for (ArrayList<Integer> e : es)
            if (e.size() != 4) {
                out.println(-1);return;
            }
        if(n<=6){
            int[] is = new int[n];
            for (int i = 0; i < n; i++)
                is[i] = i;
            do{
                boolean ok = true;
                for (int i = 0; i < n; i++) for (int j = 0; j < n; j++){
                    int d = (i-j+n)%n;
                    if(0 < d && d<=2 && !es[is[i]].contains(is[j]))ok = false;
                }
                if(ok){
                    for (int i = 0; i < n; i++)out.printFormat("%d%c",is[i]+1,i==n-1 ? '\n' : ' ');
                    return;
                }
            }while(Permutation.nextPermutation(is));
            out.println(-1);return;
        }
        int cur = 0;
        int nxt = -1;
        int bef = -1;
        for (int x : es[0]){
            int count = 0;
            for (int y : es[0]) if (x != y && es[x].contains(y))count++;
            if(count == 2){
                if(bef==-1)bef = x;
                else nxt = x;
            }
        }
        boolean[] used = new boolean[n];
        if(nxt==-1 || bef==-1){
            out.println(-1);return;
        }
        used[cur] = used[nxt] = true;
        int[] res = new int[n];
        int resPtr = 0;
        res[resPtr++] = cur;
        res[resPtr++] = nxt;
        for (int i = 0; i < n - 2; i++) {
            int nxt2 = -1;
            for (int x : es[cur])
                if (x != bef && !used[x] && es[x].contains(cur) && es[x].contains(nxt))nxt2 = x;
            if(nxt2==-1){
                out.println(-1);return;
            }
            res[resPtr++] = nxt2;
            used[nxt2] = true;
            bef = cur;
            cur = nxt;
            nxt = nxt2;
        }
        for (int i = 0; i < n; i++){
            out.printFormat("%d%c",res[i]+1,i==n-1 ? '\n' : ' ');
        }
    }
}

class MyScanner {
    private final InputStream in;

    public MyScanner(InputStream in) {
        this.in = in;
    }

    int bufLen;
    int bufPtr;
    byte[] buf = new byte[1024];

    public int read() {
        if (bufLen == -1)
            throw new InputMismatchException();
        if (bufPtr >= bufLen) {
            bufPtr = 0;
            try {
                bufLen = in.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (bufLen <= 0)
                return -1;
        }
        return buf[bufPtr++];
    }

    public int nextInt() {
        try {
            int c = read();
            if (c == -1) return c;
            while (c != '-' && (c < '0' || '9' < c)) {
                c = read();
                if (c == -1) return c;
            }
            if (c == '-') return -nextInt();
            int res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while ('0' <= c && c <= '9');
            return res;
        } catch (Exception e) {
            return -1;
        }
    }


    }

class MyPrintWriter {
    PrintWriter out;

    public MyPrintWriter(OutputStream outputStream) {
        out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public MyPrintWriter(Writer writer) {
        out = new PrintWriter(writer);
    }

    public void println(Object... os) {
        for (int i = 0; i < os.length - 1; i++) {
            out.print(os[i]);
            out.print(' ');
        }
        out.println(os[os.length - 1]);
    }

    public void close() {
        out.close();
    }

    public void printFormat(String format, Object... args) {
        out.printf(format,args);
    }

}

class Permutation {

    public static boolean nextPermutation(int[] is) {
        int n = is.length;
        for (int i = n - 1; i > 0; i--) {
            if (is[i - 1] < is[i]) {
                int j = n;
                //noinspection StatementWithEmptyBody
                while (is[i - 1] >= is[--j])
                    ;
                ArrayUtils.swap(is, i - 1, j);
                ArrayUtils.rev(is, i, n);
                return true;
            }
        }
        ArrayUtils.rev(is, 0, n);
        return false;
    }

    }

class ArrayUtils {


    public static void swap(int[] is, int i, int j) {
        int t = is[i];
        is[i] = is[j];
        is[j] = t;
    }

    public static void rev(int[] is, int s, int t) {
        while (s < --t)
            swap(is, s++, t);
    }

    }