Sunil lays three bar magnets in a row on the table, with small gaps between them. Each magnet shows its poles in a different way. Magnet P has the letters N and S. Magnet Q has only a white dot, on its right end. Magnet R is painted blue at its left end and red at its right end.

Sunil gently pushes the magnets towards each other. Which facing ends will push each other away?
