https://www.acmicpc.net/problem/11656
public class boj_11656 {
public static void main(String[] args) throws IOException {
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
List<String> read = Arrays.stream(r.readLine().split("")).collect(Collectors.toList());
List<String> box = new ArrayList<>();
int size = read.size();
for(int i =0; i<size ; i++){
box.add(read.stream().skip(i).collect(Collectors.joining()));
}
box.sort(Comparator.naturalOrder());
box.forEach(System.out::println);
}
}
public class boj_11656 {
public static void main(String[] args) throws IOException {
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
String input = r.readLine();
IntStream.range(0, input.length())
.mapToObj(i -> input.substring(i))
.sorted()
.forEach(System.out::println);
}
}
package boj;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.Arrays;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class boj_11656 {
public static void main(String[] args) throws IOException {
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter w = new BufferedWriter(new OutputStreamWriter(System.out));
String input = r.readLine();
String result = IntStream.range(0, input.length())
.mapToObj(i -> input.substring(i))
.sorted()
.collect(Collectors.joining("\n"));
w.write(result);
w.flush();
}
}