\problemname{A Pivotal Question}

Quicksort is a recursive sorting algorithm developed in 1959 by Tony Hoare.  One of the major steps in the algorithm is the {\em partition\/} step: given an element $p$ in the array (the {\em pivot\/} element) rearrange the elements in the array as shown below where all the values in $X_L$ are $\leq p$ and all elements
in $X_R$ are $> p$.
\begin{center}
\setlength{\unitlength}{2pt}
\begin{picture}(100,10)(0,0)
\put( 0, 0){\framebox(100,10){}}
\put(40, 0){\framebox(4,10){$p$}}
\put(20, 5){\makebox(0,0){$X_L$}}
\put(72, 5){\makebox(0,0){$X_R$}}
\end{picture}
\end{center}

Figure \ref{qsort:fig1} below shows an array before and after it's been partitioned with the pivot element $13$.  Note that the elements in $X_L$ and $X_R$ are typically not in sorted order and either one of them could be empty.

\begin{figure}[!h]
\begin{center}
\setlength{\unitlength}{2pt}
\begin{picture}(110,10)(0,0)
\put(0, 0){\framebox(10,10){$13$}}
\put(10, 0){\framebox(10,10){$94$}}
\put(20, 0){\framebox(10,10){$99$}}
\put(30, 0){\framebox(10,10){$1$}}
\put(40, 0){\framebox(10,10){$53$}}
\put(50, 0){\framebox(10,10){$20$}}
\put(60, 0){\framebox(10,10){$63$}}
\put(70, 0){\framebox(10,10){$8$}}
\put(80, 0){\framebox(10,10){$79$}}
\put(90, 0){\framebox(10,10){$11$}}
\put(104, 5){\vector(1,0){6}}
\end{picture}
\begin{picture}(100,10)(0,0)
\put(0, 0){\framebox(10,10){$1$}}
\put(10, 0){\framebox(10,10){$11$}}
\put(20, 0){\framebox(10,10){$8$}}
\put(30, 0){\framebox(10,10){$13$}}
\put(40, 0){\framebox(10,10){$53$}}
\put(50, 0){\framebox(10,10){$20$}}
\put(60, 0){\framebox(10,10){$63$}}
\put(70, 0){\framebox(10,10){$99$}}
\put(80, 0){\framebox(10,10){$79$}}
\put(90, 0){\framebox(10,10){$94$}}
\end{picture}
\end{center}
\caption{An array before and after a partition}
\label{qsort:fig1}
\end{figure}

How a partition is executed and how a pivot element is selected are fascinating questions but are not of interest to us.  What we would like you to do is the following: given an array, determine all the values that could be the pivot value assuming the array has been partitioned, or determine that the array has not been partitioned.


\section*{Input}

Input starts with a positive integer $n$ $(1\leq n\leq 10^6)$ denoting the size of the array.  Following this are $n$ positive integers indicating the values in the array.  All values are unique and $\leq 10^6$.

\section*{Output}

Output $m =$ the number of values in the array that could have served as pivot values to partition the array, followed by the pivot values in the order that they appear in the input.  If $m > 100$ just output the first 100 of these pivot values.  Note that a value of $m=0$ indicates that the array is not partitioned.
