Like magnetic poles repel each other, and unlike magnetic poles attract each other.
(magnetic poles; repel; each other) (magnetic poles; attract; each other)
magnetic poles magnetic poles
repel attract
each other
each other