Problems > Sort the Words

Sort the Words

Difficulty: 900 2000 ms 128 MB

strings sorting

Print the words in lexicographic (dictionary) order, separated by single spaces.

Input: one line with words separated by single spaces.

Output: the words sorted lexicographically.

Constraints:

  • 1 to 200 words of lowercase letters

Sample Tests

Input 1
banana apple cherry
Output 1
apple banana cherry
Input 2
b a
Output 2
a b

Read the Editorial

Discussion (opens after you solve — no spoilers before)

No comments yet.

Submit Your Solution

Log in or create a free account to run and submit code.