Distnace between planet A and Earth = 9.35×106km
Distance between planet B and Earth = 6.27×107km
If we take the ratio of distance between planet B to Earth and distnace between planet A and Earth. We get,
6.27×107km9.35×106km=6.279.35×10≈10
⇒ Planet B is at more disance from Earth than planet A.
So, planet A is nearer to Earth.