
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
Nalia needs to travel from point $X$ to $Y$, then from $Y$ to $Z$, and then from $Z$ to $X$. Each of these segments is either by road or rail. The cities form a right-angled triangle with $Z$ located 4000 km from $X$ and $Y$ located 5000 km from $X$. Compute the total distance Nalia travels on her journey.

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