The like poles of two magnets repel each other, and the opposite poles attract.
(The like poles of two magnets; repel; each other) (the opposite poles; attract; )
The like poles of two magnets the opposite poles
repel attract
each other