Ryan and Natalie are selling pies for a school fundraiser. Customers can buy blueberry pies and pumpkin pies. Ryan sold 7 blueberry pies and 5 pumpkin pies for a total of $163. Natalie sold 14 blueberry pies and 12 pumpkin pies for a total of $366. What is the cost each of one blueberry pie and one pumpkin pie?