Farmer John's cows have decided to offer a programming contest for the cows on Farmer Nhoj's farm. In order to make the problems as fun as possible, they have spent considerable time coming up with challenging input cases. For one problem in particular, "Haybales", the cows need your help devising challenging inputs. This involve solving the following somewhat intriguing problem:
There is an array of sorted integers x_1≤x_2≤⋯≤x_N (1≤N≤105), and an integer K. You don't know the array or K, but you do know for each index i, the largest index j_i such that x_j_i≤x_i+K. It is guaranteed that i≤j_i and j_1≤j_2≤⋯≤j_N≤N.
Given this information, Farmer John's cows need to construct any array along with some integer K that matches that information. The construction needs to satisfy 0≤x_i≤1018 for all i and 1≤K≤1018.
It can be proven that this is always possible. Help Farmer John's cows solve this problem!
The first line of input contains N. The next line contains j_1,j_2,…,j_N.
Print K, then x_1,…,x_N on separate lines. Any valid output will be accepted.
The sample output is the array a=\[1,6,17,22,27,32] with K=6. j_1=2 is satisfied because a_2=6≤1+6=a_1+K but a_3=17>1+6=a_1+K, so a_2 is the largest element that is at most a_1. Similarly,
This is not the only possible correct output for the sample input. For example, you could instead output the array \[1,2,4,5,6,7] with K=1.