Aliyah and Lea are selling pies for a school fundraiser. Customers can buy cherry pies and pumpkin pies. Aliyah sold 8 cherry pies and 14 pumpkin pies for a total of $174. Lea sold 7 cherry pies and 1 pumpkin pie for a total of $51. What is the cost each of one cherry pie and one pumpkin pie?