Science P6 MGS 2018 SA1 Q20

Two magnets, X and Y, were held close together with their south poles as shown below.When Magnet X was released, it moved along the surface of the floor.Which of the following shows the direction of the magnetic force acting on Magnet X and the direction of the gravitational force on Magnet Y?