P27207 [AtCoder] Soccer
普及+
题目描述

Problem Description

In JOI country, soccer is very popular, and the JOI league, a league tournament, is held every week.

The JOI league consists of $ N $ teams, numbered from $ 1 $ to $ N $. Every possible match combination is played exactly once. That is, $N \times (N - 1) / 2$ matches are played. The outcome of each match is determined by the points scored by each team. The winning team gets $ 3 $ points, and the losing team gets $ 0 $ points. In case of a draw, both teams get $ 1 $ point. The ranking is determined by the total points earned by each team, without considering the goal difference. Teams with the same total points are ranked equally.

As an example, consider a league with $ 4 $ teams. $4 \times (4 - 1) / 2 = 6$ matches are played. Suppose the results are as shown in the table below. The left side of the hyphen is the points scored by the team in the row, and the right side is the points scored by the team in the column.

2012-yo-t2-fig1.png


Input Format

The first line of the input contains the number of teams $ N $ ($2 \leq N \leq 100$). The following $N \times (N - 1) / 2$ lines contain the results of each match. The $ i + 1 $ line ($1 \leq i \leq N \times (N - 1) / 2$) contains integers $ A_i, B_i, C_i, D_i $ ($1 \leq A_i \leq N$, $1 \leq B_i \leq N$, $0 \leq C_i \leq 100$, $0 \leq D_i \leq 100$), separated by spaces, indicating that team $ A_i $ played against team $ B_i $, scoring $ C_i $ points and $ D_i $ points respectively. For all $ i $, $A_i \neq B_i$, and no duplicate match combinations are listed.

Output Format

The output consists of $ N $ lines. Each line contains a single integer, where the $ i $ line ($1 \leq i \leq N$) indicates the rank of team $ i $.


Sample Input and Output

Sample Input #1

4
1 2 0 1
1 3 2 1
1 4 2 2
2 3 1 1
2 4 3 0
3 4 1 3

Sample Output #1

2
1
4
2

Sample Input #2

5
1 2 1 1
3 4 3 1
5 1 1 2
2 3 0 0
4 5 2 3
1 3 0 2
5 2 2 2
4 1 4 5
3 5 4 0
2 4 0 1

Sample Output #2

2
4
1
4
3

Notes/Hints

Sample Explanation 1

The input/output example $ 1 $ corresponds to the example in the problem statement.


Sample Explanation 2

The results for input/output example $ 2 $ are as follows: 2012-yo-t2-fig2.png

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
4 1 2 0 1 1 3 2 1 1 4 2 2 2 3 1 1 2 4 3 0 3 4 1 3
样例输出
2 1 4 2