Suffix Array

Given a lowercase string, print all of its suffixes in lexicographic order, one per line.

Easy3SortingStringInterviewNo attempts yetTime limit1sMemory limit256 MB

Problem

The suffix array of a string SS is the array that holds every suffix of SS in lexicographic order.

The string banana has 6 suffixes: banana, anana, nana, ana, na, a. Sorted lexicographically they are a, ana, anana, banana, na, nana.

Given a string SS, print all of its suffixes in lexicographic order.

Input

The first line contains the string SS. It consists of lowercase English letters only, and its length satisfies 1S10001 \le |S| \le 1000.

Output

Starting from the first line, print the suffixes of SS in lexicographic order, one per line.