Sarah bought a certain number of apples and oranges from the market. She bought twice as many apples as oranges. The total cost of the apples was $18, and the total cost of the oranges was $12. If each apple costs $1 and each orange costs $2, how many apples and oranges did Sarah buy? Let's think step by step and output the final answer within \boxed{}.
user