An investment firm invested in two companies last year. They invested $8000 in Company A and made a profit of 11%. They invested $24000 in Company B and made a profit of 13%.