A permutation of n elements is a sequence of length n made up of distinct numbers from the set {1, 2, ..., n}. For example, the sequence 2, 1, 4, 5, 3 is a permutation of 5 elements.
In this problem we care about the longest increasing subsequences of a permutation. In the example permutation above, the longest increasing subsequences have length 3, and there are exactly two of them: 2, 4, 5 and 1, 4, 5.
A supernumber is any number that belongs to at least one of the longest increasing subsequences. In the permutation 2, 1, 4, 5, 3 the supernumbers are 1, 2, 4, 5, while the number 3 is not a supernumber.
Your task is to find all supernumbers of a given permutation.
Write a program that:
The input consists of two lines. The first line contains a single integer n (1≤n≤100000). The second line contains the n integers of the permutation, separated by single spaces.
The output consists of two lines. The first line contains m, the number of supernumbers in the input permutation. The second line contains the supernumbers, in increasing order, separated by single spaces.