2022 G.W. Coding Contest 1 J2: Who's the winner

You are playing a card game with your 2 friends. There are 4 types of cards you can place: a clover, a heart, a diamond, or a club.

If you place a clover or club, you get 5 points.

If you place a heart, you get 3 points.

If you place a diamond, you get 10 points.

If you place an Ace, you automatically win the game. There can only be one ace played in a game.

You win the game if you acquire the most points. Determine who will win the game.


Input Specification:
TIME CONSTRAINT: 1s

Sample Input:

Pumpkin Apple Banana
5
Pumpkin
c
c
c
c
c
Apple
h
h
c
d
ace
Banana
c
d
d
d
d

Sample Output:

Apple

Submit Solution

Problem author: Pranav