Beads

No attempts yetTime limit1sMemory limit128 MB

Problem

Byteasar has decided to start making necklaces, so he bought a very long string of colourful coral beads at a bargain price. He also owns a machine that, for a chosen integer kk (k>0k > 0), cuts the string into consecutive pieces of exactly kk beads each: the first piece is beads 1,,k1, \dots, k, the second is beads k+1,,2kk+1, \dots, 2k, and so on. If the total number of beads is not a multiple of kk, the final leftover piece (which would be shorter than kk) is discarded. Each bead's colour is a positive integer.

Byteasar values variety and wants to choose kk so that the cutting produces as many different pieces as possible. The whole string has a fixed start and end, and these two ends are not interchangeable; the machine always begins cutting from the start. Within a single cut piece, however, the two ends ARE interchangeable, so a piece may be read in either direction. For example, the pieces (1,2,3)(1,2,3) and (3,2,1)(3,2,1) count as the same piece. Write a program that finds an optimal value of kk for Byteasar.

Input

The first line contains an integer nn (1n2000001 \le n \le 200\,000): the number of beads on the string. The second line contains nn positive integers a1,a2,,ana_1, a_2, \dots, a_n (1ain1 \le a_i \le n), separated by single spaces, giving the colours of the beads in order from the start of the string.

Output

On the first line print two integers separated by a single space: the maximum number of different pieces obtainable over all choices of kk, and the number ll of values of kk that attain this maximum. On the second line print those ll values of kk in increasing order, separated by single spaces.