#C1135. Coin Flip Outcome

    ID: 40656 Type: Default 1000ms 256MiB

Coin Flip Outcome

Coin Flip Outcome

You are given a game of consecutive coin flips. In this game, each flip is represented by the character H (Heads) or T (Tails). The number of rounds is provided by an integer n and the outcomes of the coin flips by a string s of length n. Your task is to determine the outcome of the game based on the counts of heads and tails.

Formally, let \( H \) be the number of heads and \( T \) be the number of tails obtained. Print "Heads" if \( H > T \); print "Tails" if \( T > H \); and print "Tie" if \( H = T \).

The input is provided via standard input and the output should be printed to standard output.

inputFormat

The input consists of two lines. The first line contains an integer n — the number of coin flip rounds. The second line contains a string s of length n consisting of the characters H and T, representing the result of each coin flip.

Example:

5
HTHTH

outputFormat

Output a single line containing one of the strings: "Heads", "Tails", or "Tie", representing the outcome of the game as defined by the rule:

  • If the number of heads \( H \) is greater than the number of tails \( T \), output "Heads".
  • If \( T > H \), output "Tails".
  • If \( H = T \), output "Tie".
## sample
5
HTHTH
Heads