d=%w(ACB ABC)[1&i=getc%8]*?~ gets (1...2**i).map{|n|putc d[n&n-1] $_<