Input (grade 12): He was able to gradually win his way back into the graces of Hungary's monarch, and eventually marry a member of the royal family.
Output (grade 6): He was able to gradually win his way back into the graces of King Matthias.