In this question, you must rank these three gas samples according to their relative density. In doing so, you must consider their mass-to-volume ratio. Normally, both variables - mass and volume - are of equal consideration. But in this question, all three samples of gas have the same type of atoms (it says "same gas") and the same number of atoms (you can count these in the diagram). This is what determines the mass of each sample. So each sample has the same amount of mass. What then matters is the volume of the samples.
The volume refers to the amount of space that the gas sample occupies. For gases, this space is simply determined by the size of the container. The smallest container has the least volume and the largest container has the greatest volume. Since density is the mass-to-volume ratio, the density will be least where the volume is greatest. And similarly, the density will be greatest where the volume is least.