Answer
The maximum value of $~~a_2~~$ is $~~\frac{L}{4}$
Work Step by Step
The center of mass of the top brick must be directly above part of the second brick. If the center of mass of the top brick is above only air, the top brick will fall.
Note that the center of mass of each brick is at the middle of the brick.
Therefore, the maximum value of $~~a_1~~$ is $~~\frac{L}{2}$
The center of mass of the top two bricks must be directly above part of the third brick. If the center of mass of the top two bricks is above only air, the top two bricks will fall.
We can find the center of mass of the top two bricks as a distance from the right side of the diagram:
$\frac{(m)(L/2)+(m)(L/2+L/2)}{2m} = \frac{3mL/2}{2m} = \frac{3L}{4}$
Since $a_1 = \frac{L}{2}$, then the maximum value of $~~a_2~~$ is $~~\frac{L}{4}$