Input (grade 10): She was named Elizabeth after her mother, Alexandra after George V's mother, and Mary after her grandmother.
Output (grade 10): She was named after her mother, while her two middle names are those of her father's grandmother, Queen Alexandra, and her grandmother, Queen Mary.