#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, l, r, P[N], qu[N];
pair<int, int> A[N], B[N];
set<pair<int, int> > S[N * 4];
vector<int> U;
inline int Getid(int val) {
  return ((int)(lower_bound(U.begin(), U.end(), val) - U.begin()));
}
inline void Add(int id) {
  for (int i = A[id].first; i < N * 4; i += i & -i)
    S[i].insert({A[id].second, id});
}
inline void Delete(int id) {
  for (int i = A[id].first; i < N * 4; i += i & -i)
    S[i].erase({A[id].second, id});
}
inline void Get(int i, int j, int p) {
  for (; i; i -= i & -i) {
    while (S[i].size() && S[i].begin()->first <= j) {
      qu[r++] = S[i].begin()->second;
      P[S[i].begin()->second] = p;
      Delete(S[i].begin()->second);
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d%d%d", &A[i].first, &A[i].second, &B[i].first, &B[i].second);
    U.push_back(A[i].first);
    U.push_back(A[i].second);
    U.push_back(B[i].first);
    U.push_back(B[i].second);
  }
  U.push_back(-1);
  U.push_back(0);
  sort(U.begin(), U.end());
  U.resize(unique(U.begin(), U.end()) - U.begin());
  for (int i = 1; i <= n; i++) {
    A[i].first = Getid(A[i].first);
    A[i].second = Getid(A[i].second);
    B[i].first = Getid(B[i].first);
    B[i].second = Getid(B[i].second);
    Add(i);
  }
  r++;
  B[0].first = B[0].second = 1;
  while (r - l) {
    if (qu[l] == n) {
      vector<int> R;
      for (int id = n; id; id = P[id]) R.push_back(id);
      reverse(R.begin(), R.end());
      printf("%d\n", (int)R.size());
      for (int &id : R) printf("%d ", id);
      return (0);
    }
    Get(B[qu[l]].first, B[qu[l]].second, qu[l]);
    l++;
  }
  return !printf("-1");
}
