Under construction

Still being built. Things may change

Extra Krunch

Time limit1sMemory limit1024 MB

Summary
Given one line of capital letters, blanks, and punctuation, remove vowels, repeated letters, and extra blanks, then print the krunched line.
Level

Easy3 of 10

Topics
String, Hash map, Implementation
Solved
No attempts yet

Problem

A krunched word has no vowels ("A", "E", "I", "O", and "U") and no repeated letters. Removing vowels and letters that appear twice or more from MISSISSIPPI yields MSP. In a krunched word, each letter appears only once, at the first place it would appear in the unkrunched word. Vowels never appear.

Krunched phrases likewise have no vowels and no repeated letters. Consider this phrase:

RAILROAD CROSSING

and its krunched version:

RLD CSNG

Blanks are krunched differently. Blanks are removed so that a krunched phrase has no blank at its beginning or end, never has two blanks in a row, and has no blank before punctuation. Other blanks are kept. If we represent blanks by "_",

MADAM_I_SAY_I_AM_ADAM__

krunches to:

MD_SY

where the single remaining blank is shown by "_".

Write a program that reads one line of input (its length ranges from 2 to 70 characters) and krunches it. Print the krunched word or phrase to the output. The input line has only capital letters, blanks, and the standard punctuation marks: period, comma, and question mark.

Input

A single line to be krunched.

Output

A single krunched line that follows the rules above.

Examples1

  1. Example 1

    Input
    NOW IS THE TIME FOR ALL GOOD MEN TO COME TO THE AID OF THEIR COUNTRY.
    
    Expected output
    NW S TH M FR L GD C Y.