#K54102. Reorder Sentence By Word Length

    ID: 29679 Type: Default 1000ms 256MiB

Reorder Sentence By Word Length

Reorder Sentence By Word Length

Given a sentence consisting of words separated by spaces, reorder the words according to their length in non-decreasing order. If two words have the same length, their original order should be preserved.

Your task is to implement a program that reads a sentence from standard input and outputs the reordered sentence to standard output. The problem emphasizes stable sorting by word length.

inputFormat

The input consists of a single line containing the sentence. The sentence is a sequence of words separated by spaces.

outputFormat

Output the sentence after reordering the words in non-decreasing order by their length. Words with equal length must remain in the same order as in the input.

## sample
this is a test sentence
a is this test sentence