#C1071. Determine the Winner in a Card Game

    ID: 39945 Type: Default 1000ms 256MiB

Determine the Winner in a Card Game

Determine the Winner in a Card Game

You are given a card game in which each player draws one card. The card is represented by its rank followed by its suit (for example, "10D" represents the 10 of Diamonds, "AH" the Ace of Hearts, etc.).

The rank order is defined as follows: \(2 < 3 < 4 < \cdots < 10 < J < Q < K < A\). The suit is irrelevant for the comparison. Your task is to determine the winner by selecting the card with the highest rank. If there is more than one occurrence of the highest rank, the result is a tie.

The input is given via standard input, where the first line contains an integer \(n\) representing the number of players, and the second line contains \(n\) card representations separated by spaces. The output should be printed to standard output.

inputFormat

The first line contains a single integer \(n\) (the number of players). The second line contains \(n\) space-separated strings, each representing a card drawn by a player. Each card consists of its rank and its suit (with the suit being the last character).

outputFormat

If there is a unique highest card, print "Winner: ", where is the card with the highest rank. If there is more than one card with the highest rank, print "Tie".

## sample
3
8H 10D 8S
Winner: 10D

</p>