As an employee of the Macrohard Company, you have been asked to implement a new data structure for storing integer keys.
The keys are kept in a special ordered collection that behaves like an array A with infinitely many cells, numbered starting from 1. Initially every cell is empty. The collection supports a single operation, Insert(L,K), where L is a cell index and K is a positive integer.
Insert(L,K) is defined recursively:
You are given N indices L1,L2,…,LN. Starting from the empty array, perform the operations Insert(L1,1), Insert(L2,2), …, Insert(LN,N) in this order, and output the final contents of the array.
The first line contains two integers N and M: the number of Insert operations and the largest cell index that may be used in an operation (1≤N≤131072, 1≤M≤131072).
The second line contains N integers L1,L2,…,LN describing the operations to perform (1≤Li≤M).
Output the contents of the array after all of the operations have been performed. On the first line, print W, the largest index of a non-empty cell. On the second line, print the W integers A[1],A[2],…,A[W], using 0 for empty cells.