#P7694. [COCI 2009/2010 #4] AUTORI

[COCI 2009/2010 #4] AUTORI

Description

Scientific papers often cite many earlier works, so it is not uncommon for two different naming conventions to appear in the same paper. These two naming conventions are:

  • Long form, which consists of the full word of each author’s last name connected by hyphens, such as Knuth-Morris-Pratt.
  • Short form, which consists only of the first character of each author’s last name concatenated together, such as KMP.

Now, you find that a paper uses both the long form and the short form at the same time, which makes you unhappy. Therefore, you want to write a program to convert all long forms into short forms.

Input Format

The input contains only one line: a string representing the long form that appears in the paper.

The first letter of each word in the long form is guaranteed to be an uppercase letter.

Output Format

Output only one line: a string representing the short form after converting the long form.

Knuth-Morris-Pratt
KMP
Mirko-Slavko
MS
Pasko-Patak
PP

Hint

Constraints

For all testdata, the length of the string does not exceed 100100, and it contains only uppercase and lowercase English letters and the hyphen -.

Source

This problem comes from COCI 2009-2010 CONTEST 4 T1 AUTORI. With the original testdata settings, the full score is 3030 points.

Translated, organized, and provided by Eason_AC.

Translated by ChatGPT 5