#include#include #include #include using namespace std;char a[210];int main(){ while(scanf("%s",a)!=EOF) { int len = strlen(a); sort(a, a+len); cout << a << endl; int k = 1; while(next_permutation(a, a+len)) { cout << a << endl; k++;// cout << k << endl; } cout << k << endl; } string str; cin >> str; sort(str.begin(),str.end()); cout << str << endl; while (next_permutation(str.begin(), str.end())) cout << str << endl; return 0;}