
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
A positive integer is called zigzag if it satisfies the following three conditions:

- Its digits are non-zero and distinct.
- It does not have three consecutive digits in increasing order.
- It does not have three consecutive digits in decreasing order.

For example, 14385 and 2917 are zigzag, but 2564 and 71544 are not.

a) Find the largest zigzag number.

b) How many four-digit zigzag numbers are there?

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