League

No attempts yetTime limit1sMemory limit128 MB

Problem

A soccer league has $N$ teams, numbered from $1$ to $N$. In this league every pair of distinct teams plays exactly once, so a total of $N(N-1)/2$ matches are played.

In each match, the team that scores more goals wins. Points are awarded as follows:

  • Winning team: $3$ points
  • Losing team: $0$ points
  • Draw: each team gets $1$ point

The league standings are determined solely by the total number of points each team has earned; goal difference is not considered. Teams with the same total share the same rank, and that rank is the highest possible value. In other words, a team's rank equals (the number of teams with strictly more points) $+, 1$.

For example, suppose $4$ teams take part in the league, so $4(4-1)/2 = 6$ matches are played. Suppose the results are as in the table below. In each cell, the number to the left of the hyphen (-) is the score of the team in that row, and the number to the right is the score of the team in that column.

Team 1Team 2Team 3Team 4WDLPts
Team 1---0 - 12 - 12 - 21114
Team 21 - 0---1 - 13 - 02107
Team 31 - 21 - 1---1 - 30121
Team 42 - 20 - 33 - 1---1114

Team 2 has the most points and is ranked $1$st. Team 1 and Team 4 have the next-highest and equal totals, so both are ranked $2$nd. Team 3 has the fewest points and is ranked $4$th.

Given the results of all matches, write a program that computes the rank of each team.

Input

The first line contains the number of teams $N$ ($2 \le N \le 100$).

Each of the next $N(N-1)/2$ lines contains the result of one match as four integers $A$ $B$ $C$ $D$, meaning that in the match between team $A$ and team $B$, team $A$ scored $C$ points and team $B$ scored $D$ points. $A$ and $B$ are always different, and the result of the same match is never given more than once.

Output

Print $N$ lines. The $i$-th line contains the rank of team $i$.