Concept:
Friction provides acceleration to the lower block. At limiting condition:
\[
f_{max} = \mu m g
\]
Also, acceleration:
\[
a = \frac{F}{m}
\]
Step 1: Find coefficient of friction.
When 12 N is applied on A (mass 4 kg), it just slips:
\[
a = \frac{12}{4} = 3 \, \text{m/s}^2
\]
Friction force:
\[
f = m a = 4 \times 3 = 12 \, \text{N}
\]
\[
f_{max} = \mu (4g) = 12
\Rightarrow \mu = \frac{12}{4g} = \frac{3}{g}
\]
Step 2: Maximum force for no slipping.
Total mass:
\[
M = 4 + 8 = 12 \, \text{kg}
\]
Acceleration:
\[
a = \frac{F}{12}
\]
Friction needed to move A:
\[
f = m_A a = 4 \cdot \frac{F}{12} = \frac{F}{3}
\]
For no slipping:
\[
\frac{F}{3} \leq f_{max} = \mu (4g) = 12
\]
Step 3: Solve for F.
\[
\frac{F}{3} = 12 \Rightarrow F = 36 \, \text{N}
\]