x=n="";r=[] $<.read.split(/ *0?\n */).map{|l|l?-]}})&":n=l[/\d+/].to_i} f=eval"->a{#{x}1}" (2**n*2).times{|w|f[w]>0&&r<