How to Stack Pallets Safely and Efficiently