The total average age of three friends is 40. Jared is ten years older than Hakimi, and Molly's age is 30. How old is Hakimi?
Please reason step by step, and put your final answer within \boxed{}.
user