
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
Suppose \( S \) is a finite set of positive integers. When the largest integer in \( S \) is removed, the average (arithmetic mean) of the remaining integers becomes \( 40 \). If the smallest integer in \( S \) is also removed, the average of the integers left becomes \( 45 \). When the largest integer is returned to the set (keeping the smallest one out), the average rises to \( 50 \). The largest integer in the original set \( S \) is \( 80 \) greater than the smallest integer. Determine the average value of all integers in \( S \).
A) 36.2
B) 36.4
C) \( \frac{485}{9} \)
D) 54.0
E) 57.2

Present the answer in LaTex format: \boxed{Your answer}
user