You are playing a board card game. In this game the player has two characteristics, x and y — the white magic skill and the black magic skill, respectively. There are n spell cards lying on the table, each of them has four characteristics, ai, bi, ci and di. In one move a player can pick one of the cards and cast the spell written on it, but only if first two of it's characteristics meet the requirement ai ≤ x and bi ≤ y, i.e. if the player has enough magic skill to cast this spell. However, after casting the spell the characteristics of a player change and become equal to x = ci and y = di.

At the beginning of the game both characteristics of a player are equal to zero. The goal of the game is to cast the n-th spell. Your task is to make it in as few moves as possible. You are allowed to use spell in any order and any number of times (for example, you may not use some spells at all).

Input

The first line of the input contains a single integer n (1 ≤ n ≤ 100 000) — the number of cards on the table.

Each of the next n lines contains four integers ai, bi, ci, di (0 ≤ ai, bi, ci, di ≤ 109) — the characteristics of the corresponding card.

Output

In the first line print a single integer k — the minimum number of moves needed to cast the n-th spell and in the second line print k numbers — the indices of the cards in the order in which you should cast them. In case there are multiple possible solutions, print any of them.

If it is impossible to cast the n-th spell, print  - 1.

Examples

Input

4
0 0 3 4
2 2 5 3
4 1 1 7
5 3 8 8


Output

3
1 2 4


Input

2
0 0 4 6
5 1 1000000000 1000000000


Output

-1
//package codeforces.cfr335div1;

import java.io.*;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * Created by raggzy on 4/3/2016.
 */
public class D {
    private static class Reader implements Closeable {
        private BufferedReader br;
        private StringTokenizer st;

        public Reader(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }

        public void readLine() {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public String next() {
            if (st == null || !st.hasMoreTokens()) {
                readLine();
            }
            return st.nextToken();
        }

        public <T> T next(Function<String, T> parser) {
            return parser.apply(next());
        }

        public int nextInt() {
            return next(Integer::valueOf);
        }

        public long nextLong() {
            return next(Long::valueOf);
        }

        public double nexDouble() {
            return next(Double::valueOf);
        }

        @Override
        public void close() throws IOException {
            br.close();
        }
    }

    private static class Pair implements Comparable<Pair> {
        final int y;
        final int idx;

        public Pair(int y, int idx) {
            this.y = y;
            this.idx = idx;
        }

        @Override
        public int compareTo(Pair o) {
            int c1 = Integer.compare(y, o.y);
            int c2 = Integer.compare(idx, o.idx);
            return c1 != 0 ? c1 : c2;
        }
    }

    private static class Tree {
        private final int lx;
        private final int rx;
        private final int[] ys;
        private final TreeSet<Integer> idxs;
        private Tree left;
        private Tree right;

        public Tree(int lx, int rx, int[] ys) {
            this.lx = lx;
            this.rx = rx;
            this.ys = ys;
            this.idxs = new TreeSet<>((idx1, idx2) -> {
                int c1 = Integer.compare(ys[idx1], ys[idx2]);
                int c2 = Integer.compare(idx1, idx2);
                return c1 != 0 ? c1 : c2;
            });
        }

        private void build() {
            if (rx - lx >= 1) {
                int mid = (this.rx + lx) / 2;
                left = new Tree(lx, mid, ys);
                right = new Tree(mid + 1, rx, ys);
                left.build();
                right.build();
            }
        }

        private void getAllYIdx(int x, int y, Collection<Integer> res) {
            if (lx <= x && x <= rx) {
                for (int idx : idxs) {
                    if (ys[idx] > y) break;
                    res.add(idx);
                }
                if (left != null) {
                    left.getAllYIdx(x, y, res);
                }
                if (right != null) {
                    right.getAllYIdx(x, y, res);
                }
            }
        }

        private void add(int x, int idx) {
            if (x <= lx) {
                idxs.add(idx);
            } else if (x <= rx) {
                left.add(x, idx);
                right.add(x, idx);
            }
        }

        private void remove(int x, int idx) {
            if (x <= lx) {
                idxs.remove(idx);
            } else if (x <= rx) {
                left.remove(x, idx);
                right.remove(x, idx);
            }
        }
    }

    private static void generate() throws FileNotFoundException {
        PrintStream out = new PrintStream(new BufferedOutputStream(new FileOutputStream("test.in")));
        int n = 100000;
        out.println(n);
        for (int i = 0; i < n; i++) {
            out.println(String.format("%d %d %d %d", i, i, i + 1, i + 1));
        }
        out.close();
    }

    public static void main(String[] args) throws FileNotFoundException {
        long t = System.currentTimeMillis();
//        generate();
//        Reader in = new Reader(new FileInputStream("test.in"));
        Reader in = new Reader(System.in);
        PrintStream out = new PrintStream(new BufferedOutputStream(System.out));
        int n = in.nextInt();
        int[] a = new int[n];
        int[] b = new int[n];
        int[] c = new int[n];
        int[] d = new int[n];
        int[] ax = new int[n];
        int[] cx = new int[n];
        List<Integer> tmpx = new LinkedList<>();
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
            b[i] = in.nextInt();
            c[i] = in.nextInt();
            d[i] = in.nextInt();
            tmpx.add(a[i]);
            tmpx.add(c[i]);
        }
        // remapping x & removing duplicates
        Collections.sort(tmpx);
        int prev = -1;
        for (Iterator<Integer> iterator = tmpx.iterator(); iterator.hasNext(); ) {
            int curr = iterator.next();
            if (curr == prev) {
                iterator.remove();
            } else {
                prev = curr;
            }
        }
        List<Integer> x = new ArrayList<>(tmpx);
        //
        for (int i = 0; i < n; i++) {
            ax[i] = Collections.binarySearch(x, a[i]);
            cx[i] = Collections.binarySearch(x, c[i]);
        }
        // fill segtree for all squares
        Tree root = new Tree(0, x.size() - 1, b);
        root.build();
        for (int i = 0; i < n; i++) {
            root.add(ax[i], i);
        }
        //
        int[] dist = new int[n];
        int[] from = new int[n];
        Arrays.fill(dist, -1);
        Queue<Integer> current = new LinkedList<>();
        current.add(-1); // code for 0-0
        while (current.size() > 0) {
            List<Integer> achievableIdx = new LinkedList<>();
            int currIdx = current.poll();
            int currX = currIdx == -1 ? 0 : cx[currIdx];
            int currY = currIdx == -1 ? 0 : d[currIdx];
            root.getAllYIdx(currX, currY, achievableIdx);
            for (int idx : achievableIdx) {
                from[idx] = currIdx;
                dist[idx] = currIdx == -1 ? 1 : dist[currIdx] + 1;
                root.remove(ax[idx], idx);
                current.add(idx);
            }
        }
        out.println(dist[n - 1]);
        if (dist[n - 1] >= 0) {
            int it = n - 1;
            LinkedList<Integer> result = new LinkedList<>();
            while (it >= 0) {
                result.addFirst(it + 1);
                it = from[it];
            }
            out.println(result.stream().map(String::valueOf).collect(Collectors.joining(" ")));
        }
        out.close();
    }
}
