~/algor $ cat problems/string-sozlarni-saralash
Sort the words
Medium
1000 ms
128 MB
51%
A text $s$ of lowercase Latin letters and spaces is given, with words separated by a single space. Print the words sorted in dictionary (alphabetical) order; repeated words stay as many times as they occur.
Input
One line containing the string $s$.
Output
One line with the sorted words separated by single spaces.
Note
$1 \le |s| \le 10^{5}$
$s$ consists of lowercase Latin letters and spaces
$s$ 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