Input (grade 7): Her maternal grandparents were Alfonso VII of León and Berenguela of Barcelona.
Output (grade 4): Her mother's parents were Alfonso VII of León and Berenguela of Barcelona.