The magnetic field lines around a bar magnet form continuous closed loops originating from the North Pole and ending at the South Pole of the magnet. Hence, the only compass that is showing the correct direction of the magnetic field is the one that is placed below the magnet.