Abbreviation

Scan a text and replace each maximal run of two or more single-capitalized words separated by single spaces with their initials followed by the original run in parentheses.

Medium5StringSimulationImplementationGreedyInterviewNo attempts yetTime limit1sMemory limit512 MB

Problem

An abbreviation is a shortened form of a word or a phrase. The English word comes from the Latin brevis, meaning short. Write a tool that replaces every run of capitalized words with an abbreviation built from their first upper case letters, followed by the original run in parentheses.

Here are the exact definitions. A word in the text is a maximally long run of upper and lower case English letters. A capitalized word is a word made of one upper case letter followed by one or more lower case letters. For example, "Ab", "Abc", "Abcd" and "Abcde" are capitalized words, while "ab", "A", "AB", "ABc" and "AbC" are not.

An abbreviatable run is a run of two or more capitalized words in which every two neighbouring words are separated by exactly one space. No line break and no punctuation may appear inside it.

The abbreviation of an abbreviatable run is the first (upper case) letter of each of its words in order, then one space, an opening parenthesis, the original run, and a closing parenthesis.

Every run you replace is maximal: it cannot be extended by one more capitalized word on the left or on the right.

Input

The input has at most 1000 lines and each line is at most 120 characters long. Each line consists of spaces, upper and lower case English letters, commas and dots. No line has a leading or a trailing space, no line is empty, and the input has at least one line.

Output

Print the original text with every maximal abbreviatable run replaced by its abbreviation. Keep all remaining characters, spaces and punctuation included, exactly as they appear in the input.