
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 rectangle is divided into various non-overlapping squares. Two squares along one dimension sum to the length of the largest square, and the sum of two overlapping squares along the other dimension is equal to the length of the longest side of the rectangle. It is given that the width and height of the rectangle are relatively prime positive integers, and that the side length of the largest square is the same as the width of the rectangle. Find the perimeter of the rectangle.

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