A group of three friends have 3 different jobs. Mallory makes $9 an hour at Kroger, Chandler makes $11 at HEB, and Sophia makes $8 at Cinemark. All together they worked a total of 40 hours and earned $370. Mallory worked twice as many hours as Chandler.
How many hours did each friend work?