Input (grade 5): Charles IV married his first cousin Maria Louisa, the daughter of Philip, Duke of Parma, in 1765.
Output (grade 6): Charles IV married his first cousin Princess Maria Luisa, the daughter of Philip, Duke of Parma, in 1765.