#include #include #include using namespace std; int main(){ int N; cin >> N; vector> space(10002, vector(10002, -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]] = max(space[P[i]][T[i]], R[i]); } for(int i = 10000; i >= 0; i--){ for(int j = 10000; 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; } } }