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
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;

public class CF2_312B {
  
  static Reader sc = new Reader();
  static PrintWriter out = new PrintWriter(System.out);
  
  public static void main(String[] args) throws IOException {
    int n = sc.nextInt();
    
    HashMap<Integer, Integer> first = new HashMap<Integer, Integer>();
    HashMap<Integer, Integer> last = new HashMap<Integer, Integer>();
    HashMap<Integer, Integer> count = new HashMap<Integer, Integer>();
    
    int bestCount = 0;
    int lowL = 0;
    int lowR = 1000000000;
    
    for (int i = 0; i < n; i++) {
      int num = sc.nextInt();
      
      if (first.containsKey(num)) {
        last.put(num, i);
        count.put(num, count.get(num) + 1);
      } else {
        first.put(num, i);
        last.put(num, i);
        count.put(num, 1);
      }
      
      if (count.get(num) > bestCount  || (count.get(num) == bestCount && last.get(num) - first.get(num) < lowR - lowL)) {
        bestCount = count.get(num);
        lowL = first.get(num);
        lowR = last.get(num);
      }
    }
    
    out.println((lowL + 1) + " " + (lowR + 1));
          
    out.close();
  }
  
  static class Reader {
    boolean consume = false; final private int BUFFER_SIZE = 1 << 12;private byte[] buffer;private int bufferPointer, bytesRead;private boolean reachedEnd = false;public Reader() {buffer = new byte[BUFFER_SIZE];bufferPointer = 0;bytesRead = 0;}
    public boolean hasNext() {return !reachedEnd;} private void fillBuffer() throws IOException {bytesRead = System.in.read(buffer, bufferPointer = 0, BUFFER_SIZE);if (bytesRead == -1) {buffer[0] = -1;reachedEnd = true;}}
    private void consumeSpaces() throws IOException {while (read() <= ' ' && reachedEnd == false);bufferPointer--;} private byte read() throws IOException {if (bufferPointer == bytesRead) {fillBuffer();}return buffer[bufferPointer++];}
    public String next() throws IOException {StringBuilder sb = new StringBuilder();consumeSpaces();byte c = read();do {sb.append((char) c);} while ((c = read()) > ' ');if (consume) {consumeSpaces();};if (sb.length() == 0) {return null;}return sb.toString();}
    public String nextLine() throws IOException {StringBuilder sb = new StringBuilder();byte c;boolean read = false;while ((c = read()) != -1) {if (c == '\n') {read = true;break;}if (c >= ' ')sb.append((char) c);}if (!read) {return null;}return sb.toString();}
    public int nextInt() throws IOException {consumeSpaces();int ret = 0;      byte c = read();boolean neg = (c == '-');if (neg) {c = read();}do {ret = ret * 10 + c - '0';} while ((c = read()) >= '0' && c <= '9');if (consume) {consumeSpaces();}if (neg) {return -ret;}return ret;}
    public long nextLong() throws IOException {consumeSpaces();long ret = 0;byte c = read();boolean neg = (c == '-');if (neg) {c = read();}do {ret = ret * 10L + c - '0';} while ((c = read()) >= '0' && c <= '9');if (consume) {consumeSpaces();}if (neg) {return -ret;}return ret;}
    public double nextDouble() throws IOException {consumeSpaces();double ret = 0;double div = 1;byte c = read();boolean neg = (c == '-');if (neg) {c = read();}do {ret = ret * 10 + c - '0';} while ((c = read()) >= '0' && c <= '9');if (c == '.') {while ((c = read()) >= '0' && c <= '9') {ret += (c - '0') / (div *= 10);}}if (consume) {consumeSpaces();}if (neg) {return -ret;}return ret;}    public int[] nextIntArray(int n) throws IOException {int[] a = new int[n];for (int i = 0; i < n; i++) {a[i] = nextInt();}return a;}
    public int[][] nextIntMatrix(int n, int m) throws IOException {int[][] grid = new int[n][m];for (int i = 0; i < n; i++) {grid[i] = nextIntArray(m);}return grid;}
    public char[][] nextCharacterMatrix(int n) throws IOException {char[][] a = new char[n][];for (int i = 0; i < n; i++) {a[i] = next().toCharArray();}return a;}
    public void close() throws IOException {if (System.in == null) {return;} else {System.in.close();}}
  }
  
  static void print(int[] A) {for (int i = 0; i < A.length; i++) {if (i != 0) {out.print(' ');}out.print(A[i]);}out.println();}
  static <T> void print(Iterable<T> A) {int i = 0;for (T act : A) {if (i != 0) {out.print(' ');}out.print(act);i++;}out.println();}
  static void printPlus1(Iterable<Number> A) {int i = 0;for (Number act : A) {if (i != 0) {out.print(' ');}out.print(act.longValue() + 1L);i++;}out.println();  }
  static void debug(Object... o) {System.err.println(Arrays.deepToString(o));}
  
  /*
  long s = System.currentTimeMillis();
  debug(System.currentTimeMillis() - s + "ms");
   */
}
