Problem: Amr has got a large array of size n. Amr doesn't like large arrays so he intends to make it smaller.

Amr doesn't care about anything in the array except the beauty of it. The beauty of the array is defined to be the maximum number of times that some number occurs in this array. He wants to choose the smallest subsegment of this array such that the beauty of it will be the same as the original array.

Help Amr by choosing the smallest subsegment possible.

Input

The first line contains one number n (1 ≤ n ≤ 105), the size of the array.

The second line contains n integers ai (1 ≤ ai ≤ 106), representing elements of the array.

Output

Output two integers l, r (1 ≤ l ≤ r ≤ n), the beginning and the end of the subsegment chosen respectively.

If there are several possible answers you may output any of them. 

Examples

Input

5
1 1 2 2 1


Output

1 5

Input

5
1 2 2 3 1


Output

2 3

Input

6
1 2 2 1 1 2


Output

1 5

Note

A subsegment B of an array A from l to r is an array of size r - l + 1 where Bi = Al + i - 1 for all 1 ≤ i ≤ r - l + 1

Solution (in PYTHON3):

Solution:
from operator import itemgetter


class CodeforcesTask558BSolution:
    def __init__(self):
        self.result = ''
        self.n = 0
        self.array = []

    def read_input(self):
        self.n = int(input())
        self.array = [int(x) for x in input().split(" ")]

    def process_task(self):
        beauty_count = [0] * (10 ** 6)
        for a in self.array:
            beauty_count[a - 1] += 1
        mx_b = max(beauty_count)
        maxes = [x + 1 for x in range(10 ** 6) if mx_b == beauty_count[x]]
        mx_set = set(maxes)
        starts = {}
        stops = {}
        results = []
        #print(maxes)
        for x in range(self.n):
            if len(starts) == len(mx_set):
                break
            if self.array[x] in mx_set:
                if self.array[x] not in starts:
                    starts[self.array[x]] = x
        for x in range(1, self.n + 1):
            #print(x, self.array[-x])
            if len(stops) == len(mx_set):
                break
            if self.array[-x] in mx_set:
                if self.array[-x] not in stops:
                    stops[self.array[-x]] = self.n - x
        #print(starts, stops)
        for r in mx_set:
            #print(r)
            results.append((starts[r], stops[r], stops[r] - starts[r]))
        results.sort(key=itemgetter(2))
        #print(results)
        self.result = "{0} {1}".format(results[0][0] + 1, results[0][1] + 1)


    def get_result(self):
        return self.result


if __name__ == "__main__":
    Solution = CodeforcesTask558BSolution()
    Solution.read_input()
    Solution.process_task()
    print(Solution.get_result())