When the magnet AB is broken into pieces as shown in the figure below.

Polarity of A and C is north
Polarity of B and D is south
Because single poles of magnet do not exist when the magnet is broken the two poles (north and south) are created immediately.