
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
Ali Baba has 40 bags of coins. A genie can, at Ali Baba's request, determine the number of coins in each of two specified bags, but will take one coin from one of these bags for this service (and Ali Baba will not see from which bag the coin is taken). Can Ali Baba act so that after no more than 100 such procedures he can precisely determine the number of coins currently in each bag except for the last two bags checked by the genie? Each bag contains at least 1000 coins.

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