Simple strings#5248

Simple strings

2 seconds
64 megabytes
Medium

A string is called simple if it is lexicographically smaller than any of its suffixes. In addition, a string consisting of a single character is also considered simple. For example, the strings , , , and are simple, while the strings , , , and are not.

It is known that any string can be uniquely decomposed into a concatenation of simple strings in lexicographically non-increasing order. Write a program to find this decomposition.

Input

The input contains the single string to decompose into a concatenation of simple strings. The string consists of up to lowercase Latin letters and is non-empty.

Output

Print the resulting decomposition, each simple string on a separate line.

Examples

Example 1

Loading
Loading