When two magnets are brought close together, how do they attract or repel each other?