题目描述

Ranran has a sequence $a$ of $n$ integers $a_1, a_2, \cdots, a_n$ which satisfies $\displaystyle \sum \dfrac 1 {a_i} \leq \dfrac 1 2$ and he is very proud of it, so he comes up with a problem for you.
You need to find out a sequence $c$ of $m$ integers $c_0, c_1, \cdots, c_{m - 1}$. With $c$, you construct an infinite sequence $b$, and $b_i$ equals to $c_{i\bmod m}$. $b$ must satisfy the condition that in every consecutive $a_i$ numbers of $b$ there exists a number equals to $i$.
Please note that $a$ is 1-indexed and $b, c$ are 0-indexed. The value of $m$ is decided by you.
Can you solve the problem?


输入格式

The first line contains an integer $ n\left(1 \leq n \leq 10^{5}\right) $ .
The second line contains $ n $ integers $a _ {1}, a _ {2}, \cdots, a _ {n}\left(2 \leq a _ {i} \leq 2 \times 10^{5}, \sum \frac{1}{a _ {i}} \leq \frac{1}{2}\right)$.


输出格式

The first line output an integer $ m $.
The second line output $ m $ integers $c _ {0}, c _ {1}, \cdots, c _ {m-1}$.
You should guarantee that $ 1 \leq m \leq 10^{6} $ and $ 1 \leq c _ {i} \leq n $.


样例数据

输入

1
2

输出

2
1 1

备注


操作

评测记录

优秀代码

信息

时间限制: 2s
内存限制: 256MB
评测模式: Normal

题解