You might want to read up on Earnshaw's theorem, which, in the context of magnetics, can be paraphrased to state that there is no stable configuration of levitating permanent magnets - such systems always require a restriction in at least one axis to prevent one of the magnets in such a...