You are asked to watch your nephew who likes to play with toy blocks in a strange way.
He has n boxes and the i-th box has ai blocks. His game consists of two steps:
he chooses an arbitrary box i;
he tries to move all blocks from the i-th box to other boxes.