What is legal, but not logical, logical, but not legal, and neither logical, nor legal?

After having failed his exam in "Logistics and Organization", a student goes and confronts his lecturer about it.

Student, "Sir, do you really understand anything about the subject?"

Professor, "Surely I must. Otherwise I would not be a professor!"

Student, "Great, well then I would like to ask you a question. If you can give me the correct answer, I will accept my mark as is and go. If you however do not know the answer, I want you give me an 'A' for the exam."

Professor, "Okay, it's a deal. So what is the question?"

Student: "What is legal, but not logical, logical, but not legal, and neither logical, nor legal?"
Even after some long and hard consideration, the professor cannot give the student an answer, and therefore changes his exam mark into an 'A', as agreed.

Afterwards, the professor calls on his best student and asks him the same question.

He immediately answers, "Sir, you are 63 years old and married to a 35 year old woman, which is legal, but not logical. Your wife has a 25 year old lover, which is logical, but not legal. The fact that you have given your wife's lover an 'A', although he really should have failed, is neither legal, nor logical