QOJ.ac

QOJ

حد الوقت: 10 s حد الذاكرة: 256 MB مجموع النقاط: 100

#23823. Unique number

الإحصائيات

JOI-kun decided to play a game with his friends. $N$ players participate in this game. The rules of $1$ round of the game are as follows:

Each player writes their favorite integer between $1$ and $100$, inclusive, on a card and submits it. If there is no other player who wrote the same number as a player, that player receives a score equal to the number they wrote. If there is another player who wrote the same number, that player receives no score.

JOI-kun and his friends played this game $3$ times. Given the numbers written by each player in the $3$ rounds of the game, write a program to find the total score obtained by each player across the $3$ rounds.

Input

The input consists of $1 + N$ lines.

Line $1$ contains an integer $N$ ($2 \le N \le 200$), representing the number of players.

The $i$-th line ($1 \le i \le N$) of the following $N$ lines contains $3$ integers between $1$ and $100$, inclusive, separated by spaces, representing the numbers written by the $i$-th player in the $1$-st, $2$-nd, and $3$-rd rounds of the game, respectively.

Output

The output consists of $N$ lines.

On the $i$-th line ($1 \le i \le N$), output an integer representing the total score obtained by the $i$-th player across the $3$ rounds of the game.

Examples

Input 1

5
100 99 98
100 97 92
63 89 63
99 99 99
89 97 98

Output 1

0
92
215
198
89

Note

In Sample Input 1, the details of the scores obtained by each player across the $3$ rounds of the game are as follows:

  • Player $1$: $0 + 0 + 0 = 0$
  • Player $2$: $0 + 0 + 92 = 92$
  • Player $3$: $63 + 89 + 63 = 215$
  • Player $4$: $99 + 0 + 99 = 198$
  • Player $5$: $89 + 0 + 0 = 89$

Input 2

3
89 92 77
89 92 63
89 63 77

Output 2

0
63
63

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.