Zhu Jie asked in Math

John has 39 big and small bags of apples. Each big bag contains 5 apples and each small bag contains 3 apples. If there are 161 apples altogether, how many big bags and how many small bags of apples does he have?

Thank You