This one is obvious, so the next hint is the solution.
Free the prisoner and take note of a password he gives you.