400779: GYM100247 A The Power of the Dark Side
Description
On the Jedi Tournament n Jedi are battling each other. Every Jedi has three parameters: strength, agility and intelligence. All parameters of all Jedi are different. When two Jedi have a fight, the winner will be the Jedi which has more parameters higher compared to the same parameters of his opponent. For example, Jedi with parameters (5, 9, 10) defeats Jedi with parameters (2, 12, 4) because of first and third parameters.
Sith have a plan to turn one the Jedi to the dark side of the Force. It will give him a powerful skill that allows to swap some his parameters, maybe more than one time, before every fight. Sith wish their new apprentice to defeat all of the remaining Jedi.
Which Jedi can be used by Sith to lead their plan to success?
InputThe first line contains the only integer n (1 ≤ n ≤ 200000) — the number of the Jedi.
Then n lines follow. Each of them contains three integers separated by space: ai, bi and ci (1 ≤ ai, bi, ci ≤ 109) — the parameters of the Jedi.
All ai, bi and ci are pairwise distinct.
OutputIn the first line output one integer m — the number of the suitable Jedi.
In the second line output m integers — the numbers of these Jedi — in the ascending order.
ExamplesInput4Output
5 9 10
2 12 4
8 7 3
6 11 1
2Input
1 4
4Output
4 1 11
5 8 9
2 12 6
7 3 10
3
2 3 4