Rodrigo and his cousin have 8 bags of marbles. Some of the bags contain 5 white marbles. The rest of the bags contain 7 pink marbles. They have 48 marbles in all. How many bags of each color marble do the cousins have?