Java vs C++

Time limit1sMemory limit128 MB

Problem

A Java enthusiast and a C++ advocate often argue about which language is better. One of their disputes is how to write a variable name that is made of several words. The two languages follow different rules.

  • Java style: the first word is written entirely in lowercase, and from the second word on, only the first letter of each word is capitalized. The words are joined together with no separator. Examples: javaIdentifier, longAndMnemonicIdentifier, name, hELLO.
  • C++ style: every letter is lowercase, and words are separated by an underscore (_). Examples: c_identifier, long_and_mnemonic_identifier, name, h_e_l_l_o.

Given one variable name, determine which style it is written in and convert it to the other style: a C++-style name becomes Java style, and a Java-style name becomes C++ style. The order of the words is preserved during the conversion.

To be a valid C++-style name, the name must not start or end with an underscore and must not contain two consecutive underscores (every underscore must separate two words). To be a valid Java-style name, the name must contain no underscore and its first letter must be lowercase. If the given name is neither a valid Java-style name nor a valid C++-style name, print an error.

Input

The first line contains the variable name. It consists only of English letters and underscores (_), and its length is at most 100.

Output

If the given name is in Java style, print it converted to C++ style. If it is in C++ style, print it converted to Java style. If it is neither, print Error!.