The correct options are
A distance
B strength
A magnetic compass points in N-S direction when it is only influenced by the Earth's magnetic field. However, when a strong magnet is brought near it, this magnet is also influenced by the magnetic field of the strong magnet. The extent of deflection the new strong magnet has on the needle depends on its strength and distance from the magnetic compass.