#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
struct house {
int x1, y1, x2, y2;
int id;
house() : x1(0), y1(0), x2(0), y2(0) {}
};
struct point {
int x, y;
int id;
point() : x(0), y(0), id(-1) {}
point(int x_, int y_, int id_) : x(x_), y(y_), id(id_) {}
};
const point origo = point(0, 0, -1);
int n;
vector<house> v;
vector<point> pts;
vector<int> ans;
int sig(int x) {
if(x > 0) {
return 1;
}
if(x < 0) {
return -1;
}
return 0;
}
int direction(point a, point b, point c) {
// right=1, mid=0, left=-1
// (b.y/b.x)-(c.y/c.x)>0
// (b.y*c.x)-(c.y*b.x)>0
// ((b.y-a.y)*(c.x-a.x))-((c.y-a.y)*(b.x-a.x))>0
return sig(((b.y-a.y)*(c.x-a.x))-((c.y-a.y)*(b.x-a.x)));
}
bool polarsort(point a, point b) {
int dir = direction(origo, a, b);
if(dir == 0) {
return a.x < b.x;
}
if(dir == 1) {
return false;
} else {
return true;
}
}
multiset<int> cur_pts;
vector<bool> in_use;
vector<bool> is_ans;
// multiple with same d --> problem
unordered_map<int, int> id_of;
void add_rem(point p) {
int d = v[p.id].x1 + v[p.id].y1;
if(in_use[p.id]) {
in_use[p.id] = false;
cur_pts.erase(cur_pts.find(d));
} else {
in_use[p.id] = true;
cur_pts.insert(d);
id_of[d] = p.id;
}
}
void query() {
if((int) cur_pts.size() == 0) {
return;
}
int d = *(cur_pts.begin());
is_ans[id_of[d]] = true;
}
void solve() {
cin >> n;
v.assign(n, house());
for(int i = 0; i < n; i++) {
cin >> v[i].x1 >> v[i].y1 >> v[i].x2 >> v[i].y2;
v[i].id = i;
pts.pb(point(v[i].x1, v[i].y2, i));
pts.pb(point(v[i].x2, v[i].y1, i));
}
sort(pts.begin(), pts.end(), polarsort);
/*for(point p : pts) {
cout << p.x << " " << p.y << " " << p.id << "\n";
}*/
in_use.assign(n, false);
is_ans.assign(n, false);
for(int i = 0; i < (int) pts.size(); i++) {
add_rem(pts[i]);
if(i + 1 < (int) pts.size()) {
if(direction(origo, pts[i], pts[i + 1])) {
query();
}
}
}
for(int i = 0; i < n; i++) {
if(is_ans[i]) {
ans.pb(i);
}
}
cout << (int) ans.size() << "\n";
for(int x : ans) {
cout << x + 1 << " ";
}
cout << "\n";
}
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
solve();
return 0;
}