A university has the following rules for a student to qualify for a degree with A as the main subject and B as the subsidiary subject:
- He should get 55% or more in A and 45% or more in B.
- If he gets less than 55% in A he should get 55% or more in B.
However, he should get at least 45% in A.
- If he gets less than 45% in B and 65% or more in A he is allowed to reappear in an examination in B to qualify.
- In all other cases he is declared to have failed.
Write a program to receive marks in A and B and output whether the student has passed, failed or is allowed to reappear in B.