A renowned robotics company has developed a new model: a bipedal walking robot. For testing purposes, several columns, each composed of identical cubes, are arranged in a row. The robot can step from one column to the next only if the difference in their heights (i.e., the number of cubes) is no more than .
Your task is to determine the minimum number of cubes that must be removed so that the robot can traverse the entire row of columns from start to finish.
The first line contains an integer (1 \leq N \leq 10^6), representing the number of columns. The second line contains non-negative integers, each not exceeding 2 \cdot 10^6; these specify the heights of the columns.
On the first line of the output, print the minimum number of cubes that need to be removed. On the second line, print numbers, each representing the number of cubes remaining in the corresponding column.
Example 1