Niebieskie ksi.eczki
IV Olimpiada Informatyczna 1996/1997

Task: ADD
Author: Grzegorz Jakacki
ADDON

II stage contest  
Source fileADD.??? (e.g. PAS,C, CPP)
Executable fileADD.EXE
Input fileADD.IN
Output fileADD.OUT

Scientists discovered a new radioactive element - addon. It appeared that addon was the most efficient nuclear fuel ever known so it was decided that an addon reactor should be constructed.

According to the project a fuel chamber is a vertical pipe. Fuel rods, i.e. addon cylinders, are placed in a chamber one above another. Fuel rods have various lengths.

The cycle of the reactor begins with putting fuel rods into the chamber. The next step is the ignition. Unfortunately, the height of a column of fuel cannot be arbitrary - only certain heights ensure safety of the reaction. Such heights are called stable heights.

Designers of a reactor have two tasks: to establish the height of the fuel chamber and to chose the set of lengths, in which addon rods will be produced.

We say that a set of lengths is safe (for a given chamber) if for any column, which is constructed from rods whose lengths belong to this set and which is not higher than the height of the chamber, the height of this column is stable.

We say that a set of lengths is complete (for a given chamber) if every column of stable height, not higher than the height of the chamber, can be constructed of rods, whose lengths are taken from this set.

Task

Write a program that:

Input

In the first line of the text file ADD.IN there is a natural number n, 1 <= n <= 10000, which is the number of given stable heights.

In each of the following n lines there is one positive integer, not greater than 10000. These numbers represent stable heights and are given in increasing order.

Output

In the first line of the file ADD.OUT there should be written one integer - the maximal height of a chamber.

In the following lines there should be written (in increasing order) computed set of lengths (one number in one line).

Example

For the file ADD.IN
14
5
10
12
15
17
20
21
22
24
26
27
30
31
33
the correct solution is the file ADD.OUT
24
5
12
21