Mrs. Gordon had $40 to spend on cookies and pies. She bought 4 cookies, each of which cost $3. She spent twice as much on pies as she spent on cookies. Mrs. Gordon bought 3 pies that each cost the same amount. How much did each pie cost? $ How much money did Mrs. Gordon have left after buying the cookies and pies? $