Box stacking problem