A large software company has started a new high-budget project —
the game console platform called "Y-Sphere".
The company is proud of its sophisticated development process standards,
and has recently received a prestigious CMM (Capacity for Managers Maximization)
Using those powerful standards, it was easily calculated
that the project will need precisely S developers.
Now the only problem is how to manage them efficiently.
Fortunately, CMM process has the answer: of course a proper management
hierarchy is needed, that can be built by following few simple rules:
Each manager has managerial capacity —
number of immediate subordinates he can control.
He must be assigned to manage neither more (too difficult for him),
nor less (not efficient enough).
Each manager's immediate subordinates must be either
all managers (who in turn have their own subordinates),
or all developers.
Each developer and manager has exactly one immediate superior manager,
except a single highest level manager called Project Leader, who has none.
Each manager must have capacity strictly lower then his immediate superior
(so that more qualified managers take higher positions in hierarchy).
The company has managers of N different capacities.
It has unlimited number of managers of each capacity.
Your program must plan a proper management hierarchy or determine that it is impossible.
Input file format
Input contains two integers SN, followed by N different integers ai —
available managerial capacities.
Output file format
Output must contain integer M — total count of required managers,
who are numbered from 1 to M.
Next must be M pairs of integers sici, where
si is the number of i-th manager's immediate superior (or zero for Project Leader),
ci is capacity of i-th manager, taken from the list of available capacities.
If the there is no solution, output a single number −1.
If there is more than one solution, output any of them.