#include <iostream>
#include <vector>
#include <algorithm> // thêm thư viện algorithm
using namespace std;
int n, k, a[10];
string s;
vector<string> res;
void saveString() {
string r = "";
for (int i = 0; i < k; i++)
r += s[a[i]];
if (find(res.begin(), res.end(), r) == res.end())
res.push_back(r);
}
void choose(int i, int start) {
for (int j = start; j < n; j++) {
a[i] = j;
if (i == k - 1)
saveString();
else
choose(i + 1, j + 1);
}
}
int main() {
cin >> s;
n = s.length();
for (k = 1; k <= n; k++) {
choose(0, 0);
}
for (int i = 0; i < res.size(); i++)
cout << res[i] << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8YWxnb3JpdGhtPiAvLyB0aMOqbSB0aMawIHZp4buHbiBhbGdvcml0aG0KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBuLCBrLCBhWzEwXTsKc3RyaW5nIHM7CnZlY3RvcjxzdHJpbmc+IHJlczsKCnZvaWQgc2F2ZVN0cmluZygpIHsgCiAgICBzdHJpbmcgciA9ICIiOwogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBrOyBpKyspCiAgICAgICAgciArPSBzW2FbaV1dOwogICAgaWYgKGZpbmQocmVzLmJlZ2luKCksIHJlcy5lbmQoKSwgcikgPT0gcmVzLmVuZCgpKSAKICAgICAgICByZXMucHVzaF9iYWNrKHIpOyAKfQoKdm9pZCBjaG9vc2UoaW50IGksIGludCBzdGFydCkgewogICAgZm9yIChpbnQgaiA9IHN0YXJ0OyBqIDwgbjsgaisrKSB7CiAgICAgICAgYVtpXSA9IGo7CiAgICAgICAgaWYgKGkgPT0gayAtIDEpCiAgICAgICAgICAgIHNhdmVTdHJpbmcoKTsKICAgICAgICBlbHNlCiAgICAgICAgICAgIGNob29zZShpICsgMSwgaiArIDEpOwogICAgfQp9CgppbnQgbWFpbigpIHsKICAgIGNpbiA+PiBzOwogICAgbiA9IHMubGVuZ3RoKCk7CiAgICBmb3IgKGsgPSAxOyBrIDw9IG47IGsrKykgewogICAgICAgIGNob29zZSgwLCAwKTsKICAgIH0KICAgIGZvciAoaW50IGkgPSAwOyBpIDwgcmVzLnNpemUoKTsgaSsrKQogICAgICAgIGNvdXQgPDwgcmVzW2ldIDw8IGVuZGw7CiAgICByZXR1cm4gMDsKfQo=