Skip to main content
LIVE CONTEST: Round #7 · Begin Marathon is live now! …

~/algor $ cat problems/string/words-in-alphabetical-order

Words in alphabetical order

Author Iqbolshoh Ilhomjonov 3 @iqbolshoh 650 problems
Medium 1000 ms 128 MB 51%
Share

A text of lowercase Latin letters and spaces is given. Print the words sorted in dictionary (alphabetical) order; repeated words stay as many times as they occur.

Rearranging the words of the text in alphabetical order

Input

One line containing the string .

Output

One line with the sorted words separated by single spaces.

Note


consists of lowercase Latin letters and spaces
does not start or end with a space, and words are separated by exactly one space

Examples

Input #1
olma anor nok behi anor
Output #1
anor anor behi nok olma
Input #2
salom
Output #2
salom

Sign in to submit a solution

Signing up is free and takes a minute.