def pow a, b
res = 1
1.upto(b) {
|n|
res = res * a
}
res
end
def generate_subsets str, n
total = pow(2, n)
0.upto(total-1) {
|i|
0.upto(n-1) { |j|
if (i & (1<<j) != 0)
print str[j]
end
}
print "\n"
}
end
def main
str = gets.chomp
n = str.length
generate_subsets str, n
end
main
ZGVmIHBvdyBhLCBiCiAgICByZXMgPSAxCiAgICAxLnVwdG8oYikgeyAKICAgICAgfG58ICAKICAgICAgcmVzID0gcmVzICogYSAgIAogICAgfSAgCiAgICByZXMKZW5kCgpkZWYgZ2VuZXJhdGVfc3Vic2V0cyBzdHIsIG4KICAgIAogICAgdG90YWwgPSBwb3coMiwgbikKICAgIAogICAgMC51cHRvKHRvdGFsLTEpIHsgCiAgICAJfGl8ICAgIAogICAgICAgIDAudXB0byhuLTEpIHsgfGp8ICAgICAgCiAgICAgICAgICBpZiAoaSAmICgxPDxqKSAhPSAwKQogICAgICAgICAgCXByaW50IHN0cltqXQogICAgICAgICAgZW5kICAgICAKICAgICAgICB9IAogICAgICAgIHByaW50ICJcbiIKICAgIH0gICAgCmVuZAoKZGVmIG1haW4KICAgICAKCXN0ciA9IGdldHMuY2hvbXAKCW4gPSBzdHIubGVuZ3RoCiAgICBnZW5lcmF0ZV9zdWJzZXRzIHN0ciwgbgplbmQJCgptYWlu