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 In this
case, to see which one of the two bars is a magnet, pick up one,
(say, A) and lower one of its ends; first on one of the ends of the
other (say, B), and then on the middle of B