Under construction

Still being built. Things may change

Very Simple Problem

Time limit1sMemory limit128 MB

Summary
Find problems that more than half of the jury rated with its minimum score and that no jury member rated with its maximum score.
Level

Easy3 of 10

Topics
Implementation, Array
Solved
No attempts yet

Problem

While preparing a programming contest, the jury faces many hard tasks. One of them is to choose a problem that is easy enough for most, if not all, contestants to solve.

The difficulty is that the word “simple” means different things to different jury members. So the jury reaches a consensus with the following procedure. Each member assigns every proposed problem an integer “complexity rating” (different problems may receive the same rating). A member calls the problems to which they gave the minimum rating “simplest”, and the problems to which they gave the maximum rating “hardest”.

The ratings from all jury members are then compared. A problem is declared “very simple” if it was called “simplest” by more than half of the jury and was called “hardest” by nobody.

Input

The first line contains the number of jury members NN and the number of problems PP (1≤N,P≤1001 \le N, P \le 100). Each of the next NN lines contains PP integers, each a complexity rating between 00 and 10001000 inclusive.

Output

Print the numbers of the “very simple” problems in increasing order, separated by spaces. Problems are numbered starting from 11. If there are no such problems, print a single integer 00.

Examples1

  1. Example 1

    Input
    4 4
    1 1 1 2
    5 900 21 40
    10 10 9 10
    3 4 3 5
    
    Expected output
    3