Margaretas Puzzle
in Java