import sys
def generate_subsets(strr, n):
#f = open("submultimi.out", "w")
total = pow(2, n)
for i in range(1, total):
for x in range(0, n):
if i & (1<<x) != 0:
#sys.stdout.write(str(x+1) + " ")
sys.stdout.write(strr[x] + " ")
#f.write(str(x+1) + " ")
#f.write("\n")
print ""
def main():
str = "abc"
#f = open("submultimi.in", "r")
#n = int(f.readline())
n = len( str )
#n = 4
generate_subsets(str, n)
main()
aW1wb3J0IHN5cwoKZGVmIGdlbmVyYXRlX3N1YnNldHMoc3Ryciwgbik6CgogICAgI2YgPSBvcGVuKCJzdWJtdWx0aW1pLm91dCIsICJ3IikKCiAgICB0b3RhbCA9IHBvdygyLCBuKQogICAgCiAgICBmb3IgaSBpbiByYW5nZSgxLCB0b3RhbCk6CgogICAgICAgIGZvciB4IGluIHJhbmdlKDAsIG4pOgoKICAgICAgICAgICAgaWYgaSAmICgxPDx4KSAhPSAwOgoKICAgICAgICAgICAgICAgI3N5cy5zdGRvdXQud3JpdGUoc3RyKHgrMSkgKyAiICIpCiAgICAgICAgICAgICAgIHN5cy5zdGRvdXQud3JpdGUoc3Ryclt4XSArICIgIikKICAgICAgICAgICAgICAgI2Yud3JpdGUoc3RyKHgrMSkgKyAiICIpCQoKICAgICAgICAjZi53cml0ZSgiXG4iKQogICAgICAgIHByaW50ICIiCiAgICAgICAgICAgICAgIAoKZGVmIG1haW4oKToKCiAgICBzdHIgPSAiYWJjIgogICAgI2YgPSBvcGVuKCJzdWJtdWx0aW1pLmluIiwgInIiKQogICAgI24gPSBpbnQoZi5yZWFkbGluZSgpKSAgICAKICAgIG4gPSBsZW4oIHN0ciApCiAgICAjbiA9IDQKCiAgICBnZW5lcmF0ZV9zdWJzZXRzKHN0ciwgbikKbWFpbigp