@AB=map[glob<>],1..<>; for(<>){ ($X,$Y)=glob; $X<=@$_[0]&&$Y>=@$_[1]&&++$_[$i]for@AB; ++$i } ($m)=sort{$b-$a}@_; $,=$/; print$m?grep$_[$_]==$m,1..$#_:0