user
There are four boxes, each containing apples. The first box has 10 more apples than the second box. The third box has 15 fewer apples than the first box. The fourth box has twice as many apples as the third box. If there are 85 apples in total, how many apples are in each box?
assistant
Let's use algebra to solve this problem:

1. Let's denote the number of apples in the second box as x. 
2. According to the question, the first box has 10 more apples than the second box, so it contains x + 10 apples.
3. The third box has 15 fewer apples than the first box, so it contains (x + 10) - 15 = x - 5 apples.
4. The fourth box has twice as many apples as the third box, so it contains 2*(x - 5) = 2x - 10 apples.
5. Adding all these together gives us the total number of apples, which is 85:

x + (x + 10) + (x - 5) + (2x - 10) = 85
Solving this equation for x gives:
5x - 5 = 85
5x = 90
x = 18

Therefore, the second box has 18 apples, the first box has 18 + 10 = 28 apples, the third box has 28 - 15 = 13 apples, and the fourth box has 2*13 = 26 apples.