#include #include #include using namespace std; int main(){ int N; cin >> N; vector> space(10001, vector(10001, 0)); 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 = 0; i < 10000; i++){ for(int j = 0; j < 10000; 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; } } }