A doctor's prescription calls for a daily intake containing 40 milligrams (mg) of vitamin $\mathrm{C}$ and $30 \mathrm{mg}$ of vitamin D. Your pharmacy stocks two liquids that can be used: One contains $20 \%$ vitamin $\mathrm{C}$ and $30 \%$ vitamin $\mathrm{D}$ the other $40 \%$ vitamin $\mathrm{C}$ and $20 \%$ vitamin D. How many milligrams of each compound should be mixed to fill the prescription?