python program for compacting variable sized boxes.