#include #include #include using namespace std; int main(){ int N; cin >> N; vector> space(10001, vector(10001, -1)); int P[N], T[N], R[N]; for(int i = 0; i < N; i++){ cin >> P[i] >> T[i] >> R[i]; space[P[i]][T[i]] = R[i]; } for(int i = 9999; i >= 0; i--){ for(int j = 9999; j >= 0; j--){ space[i][j] = max({space[i + 1][j], space[i][j + 1], space[i][j]}); } } for(int i = 0; i < N; i++){ if(space[P[i]][T[i]] < R[i]){ cout << i + 1 << endl; } } }