Three friends, P, Q, and R, are solving a puzzle with statements:
(i) If P is a knight, Q is a knave.
(ii) If Q is a knight, R is a spy.
(iii) If R is a knight, P is a knave. Knights always tell the truth, knaves always lie, and spies sometimes tell the truth. If each friend is either a knight, knave, or spy, who is the knight?