(b=gets(p).map &:to_i).map{|i|p b.size-b.sort.rindex(i)}