
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

Let Masha have \( x \) rubles, and Petya have \( y \) rubles. The relationships between their amounts of money are given by the following equations:

\[ n(x-3) = y + 3 \]

\[ x + n = 3(y - n) \]

Express \( x \) from the second equation and substitute into the first:

\[ n(3y - 4n - 3) = y + 3 \]

\[ 3ny - y = 4n^2 + 3n + 3 \]

\[ y = \frac{4n^2 + 3n + 3}{3n - 1} \]

For \( y \) to be an integer, \( 4n^2 + 3n + 3 \) must be divisible by \( 3n - 1 \).

Testing values of \( n \) where \( 3n - 1 \) is a divisor of 40, we get:

\( n = 1 \), \( y = 5 \), \( x = 11 \)

\( n = 2 \), \( y = 5 \), \( x = 7 \)

\( n = 3 \), \( y = 6 \), \( x = 6 \)

\( n = 7 \), \( y = 11 \), \( x = 5 \)

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