Witches Puzzle

After failing to solve this puzzle (and after seeing some of my quite intelligent friends fail after hours, too), I wrote a program to check out whether there is any solution to this at all. There are 23.8 billion (fact (9) * 9^4 / 4) different ways of arranging the cards in a 3 x 3 square, so it’s fine to let a computer do that. As it turned out, there are even two distinct solutions.