David wants to pack 574 cereal bars into bags of 10 and bags of 8. The number of bags of 8 is 2 more than the number of bags of 10. How many bags of 10 and 8 can David pack all the cereal bars into?