#include <bits/stdc++.h>
using namespace std;
const int maxn = 100100;
const int INF = 2E9;
const int base = 1E9 + 7;
const int MAX_MEM = 150000000;
char mem[MAX_MEM];
int mpos = 0;
inline void* operator new(size_t n) {
  char* res = mem + mpos;
  mpos += n;
  return (void*)res;
}
inline void operator delete(void*) {}
int f[maxn], pp[maxn];
bool used[maxn];
int q[maxn], qb = 0, qe = 0;
struct vertex {
  int l, r, last;
  vector<pair<int, int> > x;
  vertex(vertex a, vertex b) {
    l = a.l, r = b.r;
    x.resize(r - l + 1);
    last = 0;
    merge(a.x.begin(), a.x.end(), b.x.begin(), b.x.end(), x.begin());
  }
  void go_del(int key, int p) {
    int id = upper_bound(x.begin(), x.end(), make_pair(key, INF)) - x.begin();
    for (int i = last; i < id; i++) {
      int v = x[i].second;
      if (used[v]) continue;
      f[v] = f[p] + 1;
      pp[v] = p;
      used[v] = 1;
      q[qb] = v;
      qb++;
    }
    last = max(last, id);
  }
  vertex(){};
};
vertex tree[4 * maxn];
int a[maxn], par[maxn];
void build(int v, int l, int r) {
  if (l == r) {
    tree[v].l = tree[v].r = l;
    tree[v].x.push_back(make_pair(a[l], par[l]));
    return;
  }
  int xx = (l + r) / 2;
  build(v + v, l, xx);
  build(v + v + 1, xx + 1, r);
  tree[v] = vertex(tree[v + v], tree[v + v + 1]);
}
void go(int v, int l, int r, int key, int ppp) {
  if (l > r) return;
  int ll = tree[v].l;
  int rr = tree[v].r;
  if (l == ll && r == rr) {
    tree[v].go_del(key, ppp);
    return;
  }
  int xx = (ll + rr) / 2;
  if (l <= xx) go(v + v, l, min(xx, r), key, ppp);
  if (xx + 1 <= r) go(v + v + 1, max(xx + 1, l), r, key, ppp);
}
int n, A[maxn], B[maxn], C[maxn], D[maxn];
pair<pair<int, int>, pair<int, int> > vv[maxn];
pair<pair<pair<int, int>, pair<int, int> >, int> sr[maxn];
int solve() {
  cin >> n;
  for (int i = 0; i < n; i++)
    cin >> vv[i].first.first >> vv[i].first.second >> vv[i].second.first >>
        vv[i].second.second;
  for (int i = 0; i < n; i++) {
    A[i] = vv[i].first.first;
    B[i] = vv[i].first.second;
    C[i] = vv[i].second.first;
    D[i] = vv[i].second.second;
  }
  sort(A, A + n);
  sort(B, B + n);
  for (int i = 0; i < n; i++) sr[i] = make_pair(vv[i], i);
  sort(sr, sr + n);
  for (int i = 0; i < n; i++)
    if (sr[i].first.first == make_pair(0, 0)) {
      int v = sr[i].second;
      used[v] = 1;
      f[v] = 1;
      pp[v] = -1;
      q[qb] = v;
      qb++;
    }
  for (int i = 0; i < n; i++)
    a[i] = sr[i].first.first.second, par[i] = sr[i].second;
  build(1, 0, n - 1);
  while (qb > qe) {
    int v = q[qe];
    qe++;
    if (v == n - 1) {
      vector<int> ans;
      while (v != -1) {
        ans.push_back(v);
        v = pp[v];
      }
      reverse(ans.begin(), ans.end());
      cout << ans.size() << '\n';
      for (int i = 0; i < ans.size(); i++) cout << ans[i] + 1 << ' ';
      cout << '\n';
      return 0;
    }
    int cx, cy;
    cx = C[v];
    cy = D[v];
    cx = upper_bound(A, A + n, cx) - A;
    cx--;
    go(1, 0, cx, cy, v);
  }
  cout << "-1\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  solve();
  return 0;
}
