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
// practice with rainboy
import java.io.*;
import java.util.*;

public class CF605D extends PrintWriter {
	CF605D() { super(System.out, true); }
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		CF605D o = new CF605D(); o.main(); o.flush();
	}

	static final int INF = 0x3f3f3f3f;
	int[] tr; int n_;
	int[] bb;
	void pul(int i) {
		int l = i << 1, r = l | 1;
		tr[i] = bb[tr[l]] <= bb[tr[r]] ? tr[l] : tr[r];
	}
	void update(int i) {
		tr[i += n_] = 0;
		while (i > 1)
			pul(i >>= 1);
	}
	int query(int l, int r) {
		int i = 0;
		for (l += n_, r += n_; l <= r; l >>= 1, r >>= 1) {
			if ((l & 1) == 1) {
				if (bb[i] > bb[tr[l]])
					i = tr[l];
				l++;
			}
			if ((r & 1) == 0) {
				if (bb[i] > bb[tr[r]])
					i = tr[r];
				r--;
			}
		}
		return i;
	}
	void main() {
		int n = sc.nextInt();
		int[] aa = new int[n + 1];
		bb = new int[n + 1]; bb[0] = INF;
		int[] cc = new int[n + 1];
		int[] dd = new int[n + 1];
		int[] ac = new int[n * 2];
		int[] qq = new int[n]; int head = 0, cnt = 0;
		int[] pp = new int[n + 1]; Arrays.fill(pp, -1);
		for (int i = 1; i <= n; i++) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int d = sc.nextInt();
			ac[aa[i] = i - 1] = a;
			ac[cc[i] = n + i - 1] = c;
			bb[i] = b;
			dd[i] = d;
			if (a == 0 && b == 0) {
				qq[head + cnt++] = i;
				pp[i] = 0;
			}
		}
		Integer[] ii = new Integer[n * 2];
		for (int i = 0; i < n * 2; i++)
			ii[i] = i;
		Arrays.sort(ii, (i, j) -> ac[i] != ac[j] ? ac[i] - ac[j] : i - j);
		for (int i = 0; i < n * 2; i++)
			ac[ii[i]] = i;
		for (int i = 1; i <= n; i++) {
			aa[i] = ac[aa[i]];
			cc[i] = ac[cc[i]];
		}
		n_ = n * 2;
		tr = new int[n_ * 2];
		for (int i = 1; i <= n; i++)
			if (pp[i] == -1)
				tr[n_ + aa[i]] = i;
		for (int i = n_ - 1; i > 0; i--)
			pul(i);
		while (cnt > 0) {
			int j, i = qq[head++]; cnt--;
			if (i == n) {
				cnt = 0;
				while (i != 0) {
					qq[cnt++] = i;
					i = pp[i];
				}
				println(cnt);
				while (cnt-- > 0)
					print(qq[cnt] + " ");
				println();
				return;
			}
			while (bb[j = query(0, cc[i])] <= dd[i]) {
				update(aa[j]);
				qq[head + cnt++] = j;
				pp[j] = i;
			}
		}
		println(-1);
	}
}
