403391: GYM101149 F The Weakest Sith

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

F. The Weakest Sithtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

In a galaxy far, far away the great galactic empire had collapsed after the death of the emperor, and now a new corrupted galactic republic gradually grows stronger. But the evil Sith don't spend time in vain: they've created opposition named «The last order» and now they are planning to choose a leader by a fair tournament.

In the tournament there will be n Siths who has left alive. The i-th of these Siths has three integer characteristics: mastery of lightsabers ai, mastery of the Force bi and the level of mental balance ci. All characteristics of all Siths are different. The tournament consists of one on one fights. The winner of each of these fights is the Sith who has at least two characteristics that are bigger than their opponent's corresponding ones.

The problem is that the Sith tournaments have never been organized to find the strongest Sith who could beat anyone else: instead, they were supposed to distinguish the weakest one, somebody who couldn't win any fight, and to let everybody take a good laugh at that loser. It seems like such Sith will become the leader of «The last order», so it'd be good to know them in advance.

Input

The first line contains a single integer n (2 ≤ n ≤ 2·105) — the number of the Siths who will participate in the tournament.

Each of the next n lines contains three space-separated integers: ai, bi, ci (1 ≤ ai, bi, ci ≤ 109) — the three corresponding characteristics of the i-th Sith.

Output

In the first line output a single integer — the number of Siths who can't win any fight.

In the second line print the numbers of those Siths separated by a space.

ExamplesInput
4
3 11 9
1 4 8
5 2 10
12 7 6
Output
1
2
Input
3
700 40 1
50 2 800
3 900 60
Output
0

加入题单

上一题 下一题 算法标签: