A total of ​$24,000 is to be invested in stocks and bonds. If the amount invested in bonds is three times that invested in​ stocks, how much is invested in each​ category?