#### Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

## Problem Description

In the year 2100, the results of the JC2 prelim examinations are finally out and the school is getting a huge headache trying to rank all the students. Due to a huge inflation in educational qualifications, students take a lot of subjects to obtain a good portfolio and all the marks are making the teachers go crazy. You are to create a program to help solve the teachers' dilemma.

There are a total of *N* students taking *S* subjects each. The students are ranked according to the following four aspects in order of priority.

- Mean subject score
- Highest subject score
- Median subject score
- Input order

See the sample input if unclear

## Input

The first line of input consists of 2 integers: *N* and *S*.

The following *N* lines contain *S* integers between 0 and 100 inclusive with the integers on the *ith* line representing the scores of student *i*

## Output

On the *ith* line, output the student number that is ranked *ith* based on the ranking above

## Limits

Subtask 1 (0%): Sample

Subtask 2 (50%): 0 < *N,S* ≤ 1000

Subtask 3 (50%): 0 < S ≤ 100 and 0 < *N* ≤ 50000

## Sample Input 1

3 2 75 75 50 100 100 0

## Sample Output 1

2 1 3

### Tags

### Subtasks and Limits

Subtask | Score | #TC | Time | Memory | Scoring |
---|---|---|---|---|---|

1 | 0 | 1 | 1s | 64MB | Minimum |

2 | 50 | 10 | 1s | 64MB | Minimum |

3 | 50 | 10 | 1.5s | 65MB | Minimum |

### Judge Compile Command

g++ ans.cpp -o ranking -Wall -static -O2 -lm -m64 -s -w -std=gnu++14 -fmax-errors=512