input: abcd output: a b c d ab ac ad bc bd cd abc abd acd bcd abcd