#include <bits/stdc++.h>
using namespace std;
const int MaxN = 200007;
const int oo = 1000000000;
struct NodeTp {
  int a, b, c, d, id, nxt;
};
struct SegTp {
  int l, r, m;
};
int n, l, x[MaxN], y, t;
NodeTp dt[MaxN];
int fir[MaxN];
SegTp seg[MaxN << 2];
int fr, re, q[MaxN << 1];
int dist[MaxN], fa[MaxN];
bool flg;
inline int BinS(int dt) {
  int l, r, m;
  l = 1;
  r = x[0];
  while (l <= r) {
    m = (l + r) >> 1;
    if (x[m] <= dt)
      l = m + 1;
    else
      r = m - 1;
  }
  return l - 1;
}
inline int Min_(int a, int b) {
  if (a < b) return a;
  return b;
}
bool Cmp(NodeTp a, NodeTp b) {
  if (a.a == b.a) {
    if (a.b > b.b) return true;
    return false;
  }
  if (a.a < b.a) return true;
  return false;
}
void MakeSeg(int id, int l, int r) {
  seg[id].l = l;
  seg[id].r = r;
  if (l == r) {
    seg[id].m = dt[fir[l]].b;
  } else {
    int lc, mi;
    lc = id << 1;
    mi = (l + r) >> 1;
    MakeSeg(lc, l, mi);
    MakeSeg(lc + 1, mi + 1, r);
    seg[id].m = Min_(seg[lc].m, seg[lc + 1].m);
  }
  return;
}
void Init() {
  int i, j, k;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    dt[i].id = i;
    scanf("%d%d%d%d", &dt[i].a, &dt[i].b, &dt[i].c, &dt[i].d);
  }
  for (i = 1, l = 1, x[0] = 0; i <= n; i++) x[++l] = dt[i].a;
  sort(x + 1, x + 1 + l);
  for (i = j = 1; i <= l; i++)
    if (x[j] != x[i]) x[++j] = x[i];
  x[0] = j;
  k = j;
  for (i = 1; i <= n; i++) dt[i].a = BinS(dt[i].a), dt[i].c = BinS(dt[i].c);
  for (i = 1, l = 1, x[0] = 0; i <= n; i++) x[++l] = dt[i].b;
  sort(x + 1, x + 1 + l);
  for (i = j = 1; i <= l; i++)
    if (x[j] != x[i]) x[++j] = x[i];
  x[0] = j;
  for (i = 1; i <= n; i++) dt[i].b = BinS(dt[i].b), dt[i].d = BinS(dt[i].d);
  sort(dt + 1, dt + 1 + n, Cmp);
  for (i = 1; i <= n; i++) fir[i] = -1;
  for (i = 1; i <= n; i++) dt[i].nxt = fir[dt[i].a], fir[dt[i].a] = i;
  MakeSeg(1, 1, k);
  return;
}
void BFS(int id, int l, int r) {
  if (seg[id].m > y) return;
  if (flg) return;
  if (seg[id].l == seg[id].r) {
    int i;
    for (i = fir[seg[id].l]; i != -1 && !flg; i = dt[i].nxt) {
      if (dt[i].b <= y) {
        q[++re] = i;
        dist[dt[i].id] = dist[t] + 1;
        fa[dt[i].id] = t;
        if (dt[i].id == n) flg = true;
      } else
        break;
    }
    fir[seg[id].l] = i;
    if (i == -1)
      seg[id].m = oo;
    else
      seg[id].m = dt[i].b;
    return;
  } else {
    int lc = id << 1;
    if (l <= seg[lc].r) {
      BFS(lc, l, r);
      if (flg) return;
    }
    if (r > seg[lc].r) {
      BFS(lc + 1, l, r);
      if (flg) return;
    }
    seg[id].m = Min_(seg[lc].m, seg[lc + 1].m);
  }
  return;
}
void Prpath(int x) {
  if (x == 0) return;
  Prpath(fa[x]);
  printf("%d ", x);
  return;
}
void Solve() {
  int i, j, x;
  flg = false;
  dt[0].a = dt[0].b = dt[0].c = dt[0].d = 1;
  dt[0].id = 0;
  dist[0] = 0;
  fr = re = 1;
  q[re] = 0;
  while (fr <= re) {
    x = dt[q[fr]].c;
    y = dt[q[fr]].d;
    t = dt[q[fr]].id;
    BFS(1, 1, x);
    if (flg) break;
    fr++;
  }
  if (!flg)
    printf("-1\n");
  else {
    printf("%d\n", dist[n]);
    Prpath(n);
    printf("\n");
  }
  return;
}
int main() {
  Init();
  Solve();
  return 0;
}
