Woburn Challenge 2016-17 Round 1 - Junior Division

Problem 2: Frankenstein's Monster

Frank is upset. "Frankenstein is so big and scary, Frankenstein this, Frankenstein that", he thinks to himself. "Doesn't anyone know that Frankenstein is the name of the scientist, and who they're actually referring to is Frankenstein's monster!?".

He's determined to remedy the situation once and for all. How? It's quite simple. Since everyone derives their knowledge entirely from the internet, Frank will just have to find every occurrence of the word "Frankenstein" on every website, and replace it with "Frankenstein's monster". Problem solved!

For starters, Frank is tackling a Universal Pictures monster fanfiction site. He's downloaded the raw text of one particular story, a string with at most 1000 characters. For convenience, every space has been replaced with a period. As such, the string contains no whitespace, and consists of only lower/uppercase letters, digits, and common punctuation.

A "word" is a maximal consecutive sequence of non-period characters in the string. That is, each word is either preceded by a period or is at the start of the string. Similarly, each word is followed by a period or is at the end of the string. Frank wants to replace each instance of the word "Frankenstein" with the two words "Frankenstein's" "monster" (separated by a period). Frank distinguishes uppercase and lowercase letters, so he doesn't want to replace the word "frankenstein", for example.

Input Format

The first and only line of input consists of a single string representing the content of the story.

Output Format

Output a single line consisting of a single string representing the "corrected" story.

Sample Input


Sample Output


All Submissions
Best Solutions

Point Value: 5
Time Limit: 2.00s
Memory Limit: 16M
Added: Oct 16, 2016
Author: SourSpinach

Languages Allowed:

Comments (Search)

I said the commas were there for grammar, the question clearly states that there is a period after each word

I don't understand. It says that "each word is followed by a period or is at the end of the string", while the input has a period AT THE END of the string. Why is this problem's wording so confusing?

um no, just as you stated, each word is followed by a period as you can clearly see, and there are commas to provide grammar fixes, and is followed means there is a period AT THE END of the string, can you please try to understand it before putting comments like this

So the period at the end of the last word (in the case of the example, "Imhotep") is just grammar-fixing?

I keep getting wrong answer even though my solution works for the sample Input and other inputs that I make up.

You have to check if the first and last word is Frankenstein.