题目描述
Background
Great scientific discoveries are typically named after the scientists' surnames. For instance, the widely used asymmetric cryptographic system RSA was discovered by scientists named Rivest, Shamir, and Adleman, and the more commonly known Knuth-Morris-Pratt algorithm was named after scientists Knuth, Morris, and Pratt.
Problem Description
Scientific papers often cite numerous early works, so it is not uncommon to encounter two different naming conventions within a single paper. These conventions are:
- The long variant, which consists of the full surnames of the authors connected by hyphens, such as
Knuth-Morris-Pratt. - The short variant, which is composed of the first characters of each author's surname, such as
KMP.
You have come across a paper that uses both the long and short variants, which you find unpleasant. Therefore, you want to write a program that converts all long variants into short variants.
Input Format
The input consists of a single line, a string representing the long variant found in the paper.
Each word in the long variant starts with a capital letter.
Output Format
The output should be a single line, a string representing the short variant after transformation.
Sample Input and Output
Sample Input #1
Knuth-Morris-Pratt
Sample Output #1
KMP
Sample Input #2
Mirko-Slavko
Sample Output #2
MS
Sample Input #3
Pasko-Patak
Sample Output #3
PP
Notes
[Data Range]
For all data, the length of the string does not exceed $100$ and it contains only uppercase and lowercase English letters and hyphens -.
[Problem Source]
This problem is from COCI 2009-2010 CONTEST 4 T1 AUTORI, configured according to the original problem data, with a full score of $30$ points.
Provided by Eason_AC for translation and arrangement.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分