P17815 [ICPC 2019 Nanchang R] Who is the Champion

Description

Soccer is probably the sport with the greatest fans in this country. However, the national team has a poor record on the world stage. In order to energize youth players, the Soccer National Championship is organized every year. In this year, there are $n$ teams taking part in the championship. As usual, the single round-robin system is adopted so that each team plays every other team once. A standard match asks ten players and a goalkeeper for both teams, which contains $22$ players in total. They confront each other, defend their nets and attack the opponent's goal in a rectangular grass court. In a 90-minute game, they try to shoot again and again. When the game is over, the team with higher goals will win and obtain $3$ points in the scoreboard, while the loser will obtain nothing. A very special but common case is that both teams get the same goals, which is a draw; then both of them will obtain one point in the scoreboard. At the end of the season, the league will declare the champion which is the team with the highest score in total. If two or more teams have the same highest score in total, the one with the highest goal differential (which is calculated as the number of goals scored in all league matches minus the number of goals conceded) will be the champion. The worst situation that several teams have the same highest score in total and the same goal differential will be solved by extra play-offs.

Input Format

The first line contains an integer $n~(1\le n \le 100)$ indicating the number of teams. Each of the following $n$ lines contains $n$ integers. The $j$-th integer in the $i$-th line, which is non-negative and up to five, represents the number of goals scored by the $i$-th team against the $j$-th team. We guarantee that $a_{i,i}=0$ for all $1\le i \le n$.

Output Format

If the league can declare the champion, output the index of the team who will be the champion or output `play-offs` (without quotes), if extra play-offs will be organized.