import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
public class Main {
static String[] arr;
public static void main(String[] args) throws IOException {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
String text = bf.readLine();
solve(text);
for (String N : arr) {
System.out.println(N);
}
}
static String[] solve (String text) {
arr = new String[text.length()];
for (int i = 0; i<text.length(); i++) {
arr[i] = text.substring(i);
}
Arrays.sort(arr);
return arr;
}
}
text.substring(i)
를 통해서 배열에 저장하고 정렬하면 끝이다.