There are three persons (Alex, Brook and Cody). One of whom is a knight, one is a knave and one is a spy.
The knight always tells the truth, the knave always lies and the spy can either lie or tell the truth.
Alex says: "Cody is a knave."
Brook says: "Alex is a knight."
Cody says: "I am the spy."
Who is the knight, who the knave, and who the spy?