For them to be in static equilibrium all forces acting on them have to add up to 0, and all torques have to add up to 0, too. You can also click on each book and then move it with the arrow keys on your keyboard.
Positive numbers mean that the entire book is outside the support.
The first condition for stability of the pile is that the center of mass of the top book is above book 2. And so on. Since we chose L as 100 pixels, x can maximally be 58 pixels.