Thomas goes to the bakery on Monday and spends $24 on 5 cupcakes and 1 cookies. He goes back on Friday and spends $29.25 on 3 cupcakes and 6 cookies. If all he bought were cupcakes and cookies, how much do each cost? Let x represent cupcakes and y represent cookies. Write and solve a system of equations.