gets a=gets.split.map &:to_i r=0 0.step(31){|i|r|=1<