Olivia ordered cupcakes and a layer cake. Together she paid $52. She paid $12 more on the layer cake than on the cupcakes. What was the price of each?