#include <cstdio> #include <iostream> #include<string> #include <vector> #include <algorithm> using namespace std; typedef struct S{ string c; int lo; }S; S s[1000]; bool cmp(S s1,S s2) { return s1.c<s2.c; } int main() { string s1; cin>>s1; int len =s1.size(); for(int i = 0;i<s1.size();i++) { s[i].c=s1.substr(i,len-i); s[i].lo = i; } sort(s,s+s1.size(),cmp); for(int i=0;i<s1.size();i++) { // string sss = s1.substr(s[i].lo,len-s[i].lo); cout<<s[i].c<<endl; } } // 64 位输出请用 printf("%lld")