22 lines
413 B
C++
22 lines
413 B
C++
// Creating Strings
|
|
|
|
#include<bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
|
|
int main() {
|
|
set<string> combinations;
|
|
string s;
|
|
cin >> s;
|
|
sort(s.begin(), s.end());
|
|
do {
|
|
combinations.insert(s);
|
|
} while (next_permutation(s.begin(), s.end()));
|
|
combinations.insert(s);
|
|
cout << combinations.size() << endl;
|
|
for(auto p: combinations) {
|
|
cout << p << endl;
|
|
}
|
|
return 0;
|
|
}
|