The mass is the measure of inertia and it is also the measure of gravitational attraction (it is the open question why and whether there are some conditions when this equivalence is broken, but for practical purposes it is absolutely true).
To determine the (gravitational) mass of those balls we need the notion of density. Each piece of a substance at a given pressure and temperature has the same ratio of the mass to the volume, called density.
If we denote the volume of each ball as `V` and the masses as `m_A,` `m_B` and `m_C,` then `rho_A = m_A/V,` `rho_B = m_B/V,` `rho_C = m_C/V.` In other words, `m_A = rho_A*V,` `m_B = rho_B*V,` `m_C = rho_C*V.`
Because the density of mercury is much more then of water, and the density of water is much more then of air, we can infer that `m_A` is much greater than `m_B` and `m_B` is much greater than `m_C.`