#d11006. 山脉

山脉

Mountain Range

Problem Description

For a sequence a1,a2,…,ana_1, a_2, \dots, a_n, a subsegment al,al+1,…,ara_l, a_{l+1}, \dots, a_r is called mountain-shaped if there exists an index mid∈[l+1,r−1]mid \in [l+1, r-1] such that al,al+1,…,amida_l, a_{l+1}, \dots, a_{mid} is non-decreasing, amid,amid+1,…,ara_{mid}, a_{mid+1}, \dots, a_r is non-increasing, and r−l+1≥3r - l + 1 \ge 3.

For an integer kk (3≤k≤n3 \le k \le n), if the subsegments $[1, k], [k+1, 2k], \dots, [(m-1)k+1, mk], [mk+1, n]$ are all mountain-shaped, and mk≤nmk \le n, n−mk<kn - mk < k, then we call the sequence aa a mountain range.

You are given a positive integer sequence aa, where a value of −1-1 may stand for any number. Find all integers kk for which aa is a mountain range.

Input Format

The first line contains an integer nn (1≤n≤1051 \le n \le 10^5), the length of the sequence.

The second line contains nn integers a1,a2,…,ana_1, a_2, \dots, a_n (1≤ai≤1091 \le a_i \le 10^9 or ai=−1a_i = -1).

Output Format

The first line contains an integer mm, the number of valid kk.

Then output mm lines, each containing one valid integer kk in ascending order.

Sample Input

11
7 -1 11 10 -1 -1 26 14 9 12 -1

Sample Output

1
4