A repulsive force in
some situation establishes that both are magnetised If it is
always attractive, then one of them is not magnetised In a bar
magnet the intensity of the magnetic field is the strongest at the
two ends (poles) and weakest at the central region This fact
may be used to  determine whether A or B is the magnet