human
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
Solve the task in PYTHON3.

=====
Can you provide a the Python code you requested?
assistant
#Here is the Python code you requested.

#!/usr/bin/env python
# 558B_larray.py - Codeforces.com 558B Larray quiz
#
# Copyright (C) 2015 Sergey
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#       http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
Help Amr by choosing the smallest subsegment possible.
Input

The first line contains one number n , the size of the array.

The second line contains n integers ai , representing elements of the
array.
Output

Output two integers l,r, the beginning and the end of the subsegment
chosen respectively.

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

# Standard modules
import unittest
import sys
import re
import random
import bisect
import array

# Additional modules

###############################################################################
# Larray Class
###############################################################################

class Larray:
    """ Larray representation """

    def __init__(self, args):
        """ Default constructor """

        self.n = args[0]
        self.list = args[1]

        self.freq = {}
        for i in range(self.n):

            key = self.list[i]
            if key in self.freq:
                (it, len, min, max) = self.freq[key]
                it += 1
                if i < min:
                    min = i
                    len = min - max
                if i > max:
                    max = i
                    len = min - max
                self.freq[key] = (it, len, min, max)
            else:
                self.freq[key] = (1, 0, i, i)

    def calculate(self):
        """ Main calcualtion...