As an adolescent, he had a particular love of theology and the Scriptures became the foundation of his spirituality. During his studies in Palencia, Spain, he experienced a dreadful famine, prompting Dominic to sell all of his beloved books and other equipment to help his neighbors. After he completed his studies, Bishop Martin Bazan and Prior Diego d'Achebes appointed Dominic to the cathedral chapter and he became a regular canon under the Rule of St. Augustine and the Constitutions for the cathedral church of Osma. At the age of twenty-four or twenty-five, he was ordained to the priesthood.