#include<iostream> #include<string> #include<vector> #include<algorithm> using namespace std; bool cmp(string a, string b) { return a.compare(b) < 0; } int main() { string input_str; cin >> input_str; string temp = ""; vector<string>houzhui_list; for (int i = input_str.size() - 1; i >= 0; i--) { temp = input_str[i] + temp; houzhui_list.push_back(temp); } sort(houzhui_list.begin(), houzhui_list.end(), cmp); for (int i = 0; i < houzhui_list.size(); i++) { cout << houzhui_list[i] << endl; } }