Girls Invitational '19 J2 - Emily Who

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 2.0s
Memory limit: 128M

Author:
Problem type

Catherine has just gotten a new SIM card and is asking friends to text her their names so she can add their contacts to her new phone. However, she has run into a big problem: two of her friends are both named Emily Hu! Catherine knows that each Emily will get mad if she is mixed up with the other Emily, so she doesn't want to ask which Emily is messaging her. Instead, she decides to analyze their messages to see if she can use her knowledge of their personalities to figure out who is messaging her.

To avoid confusion at school, the nicknames Emily 1 and Emily 2 are used. Despite having the same name, the two Emilys are very different!

  • Emily 1 is very calm, so she will frequently use lowercase letters and properly punctuate her sentences.
  • A majority of Emily 1's words will be written with lowercase letters, and more often than not, her sentences will end with periods.
    • Knowing this, Catherine likes to reply to Emily 1 using a period.
  • Emily 2 is a very excited person, so she will frequently use uppercase letters and exclamation marks to express her excitement!
  • A majority of Emily 2's words will be written with uppercase letters, and more often than not, she will use exclamation marks as punctuation!
    • Knowing this, Catherine likes to reply to Emily 2 using an exclamation mark!

Given a sentence, S, from an Emily Hu, can you help Catherine respond to it with an appropriate greeting to the appropriate Emily?

Input Specification

The first and only line will contain a string, S (1 \le |S| \le 10^3), containing several words consisting of both uppercase and lowercase alphabetical letters, followed by punctuation of either periods or exclamation marks, and separated by spaces.

It is guaranteed that there is only one space between any two words, and no trailing/leading spaces. It is also guaranteed that a message will either clearly only be from Emily 1 (more lowercase letters and periods than uppercase letters and exclamation marks) or clearly only be from Emily 2 (more uppercase letters and exclamation marks than lowercase letters and periods).

Output Specification

  • If S was a message from Emily 1, output Hi, Emily.
  • If S was a message from Emily 2, output Hi, Emily!

Sample Input

hI CATHERINE this is EMILY HU! are you eXCITED for the girls INVITATIONAL. it will be super FUN!

Sample Output

Hi, Emily!

Explanation for Sample

There are more exclamation marks and uppercase characters than there are periods and lowercase characters. This means the message is from Emily 2!


Comments

There are no comments at the moment.