Unique

Time limit1sMemory limit128 MB

Summary
For each of three rounds, a player scores the number written only if no one else wrote it, and totals are printed in input order.
Level

Easy3 of 10

Topics
Array, Hash map, Simulation
Solved
No attempts yet

Problem

Sang-geun and his friends play the following game on a trip.

Each player picks one integer between 1 and 100 (inclusive), writes it on a card, and submits it. If no other player wrote the same number, that player earns points equal to the number they wrote. If at least one other player wrote the same number, that player earns no points in that game.

They played this game three times in total. Given the numbers each player wrote in the three games, compute the total score each player earned across all three games.

Input

The first line contains the number of participants NN. (2≤N≤2002 \le N \le 200)

Each of the next NN lines contains the numbers a player wrote in the first, second, and third game, separated by spaces.

Output

Print the total score each player earned across the three games, one per line, in the same order as the input.

Hint

In the first example, each player's score is computed 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

Examples2

  1. Example 1

    Input
    5
    100 99 98
    100 97 92
    63 89 63
    99 99 99
    89 97 98
    
    Expected output
    0
    92
    215
    198
    89
    
  2. Example 2

    Input
    3
    89 92 77
    89 92 63
    89 63 77
    
    Expected output
    0
    63
    63