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 k (k>0), cuts the string into consecutive pieces of exactly k beads each: the first piece is beads 1,…,k, the second is beads k+1,…,2k, and so on. If the total number of beads is not a multiple of k, the final leftover piece (which would be shorter than k) is discarded. Each bead's colour is a positive integer.
Byteasar values variety and wants to choose k 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) and (3,2,1) count as the same piece. Write a program that finds an optimal value of k for Byteasar.
The first line contains an integer n (1≤n≤200000): the number of beads on the string. The second line contains n positive integers a1,a2,…,an (1≤ai≤n), separated by single spaces, giving the colours of the beads in order from the start of the string.
On the first line print two integers separated by a single space: the maximum number of different pieces obtainable over all choices of k, and the number l of values of k that attain this maximum. On the second line print those l values of k in increasing order, separated by single spaces.