Longest Bicolored Sequence#11318

Longest Bicolored Sequence

1 second
128 megabytes
Very easy

Given the stripe 1 \times n cells. Each cell is colored by one of 10^4 colors. The cells are enumerated from leftmost to rightmost one by sequential integers between and , inclusively.

Your task is to find the longest continuous sequence of the cells such that total number of colors in that sequence does not exceed . If there are more than one longest sequence, print the leftmost of them.

Input

The first line contains one integer n~(1 \le n \le 10^5) — the length of the stripe. The second line contains integers c_i~(1 \le c_i \le 10^4) — the colors of the cells, listed from leftmost one to rightmost one. The cells of the same color are denoted by the same integer, the cells that have distinct colors — by different integers.

Output

Print two integers — the number of the cell where the longest continuous sequence that contains the cells of no more than two colors starts, and the length of this sequence. If there are more than one solutions, print one with the smallest first value (i.e. the leftmost one).

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading

Example 3

Loading
Loading