Building need to sort the input cubes