Problem: The array a with n integers is given. Let's call the sequence of one or more consecutive elements in a segment. Also let's call the segment k-good if it contains no more than k different values.

Find any longest k-good segment.

As the input/output can reach huge size it is recommended to use fast input/output methods: for example, prefer to use scanf/printf instead of cin/cout in C++, prefer to use BufferedReader/PrintWriter instead of Scanner/System.out in Java.

Input

The first line contains two integers n, k (1 ≤ k ≤ n ≤ 5·105) — the number of elements in a and the parameter k.

The second line contains n integers ai (0 ≤ ai ≤ 106) — the elements of the array a.

Output

Print two integers l, r (1 ≤ l ≤ r ≤ n) — the index of the left and the index of the right ends of some k-good longest segment. If there are several longest segments you can print any of them. The elements in a are numbered from 1 to n from left to right.

Examples

Input

5 5
1 2 3 4 5


Output

1 5


Input

9 3
6 5 1 2 3 2 1 4 5


Output

3 7


Input

3 1
1 2 3


Output

1 1

Solution (in JAVA):

Solution:
import java.io.*;
import java.math.*;
import java.util.*;


public class Main {
	
	static final int mod=(int)1e9+7;
	
	public static void main(String[] args) {
        FasterScanner s = new FasterScanner();
        PrintWriter out=new PrintWriter(System.out);
        
        int n=s.nextInt();
        int k=s.nextInt();
        
        int[] a=s.nextIntArray(n);
        
        int N=(int)(1e6+1);
        
        int[] b=new int[N];
        int i=0;
        int j=0;
        int maxlen=0;
        int maxi=0;
        
        int count=0;
        while(i<n && j<n){
        	while(j<n) {
        		if(b[a[j]]==0){
        			if(count<k)
        				count++;
        			else
        				break;
        		}
        		b[a[j]]++;
        		j++;
        	}
        	if(j-i>maxlen){
        		maxlen=j-i;
        		maxi=i;
        	}
        	b[a[i]]--;
        	if(b[a[i]]==0)
        		count--;
        	i++;
        }
        System.out.println((maxi+1)+" "+(maxi+maxlen));
        
        
        
        
        
        
        
        
        
        
        
        
        
        out.close();
        
	}
	
	
	
	public static long pow(long x, long n, int mod) {
		long res = 1;
		for (long p = x; n > 0; n >>= 1, p = (p * p) % mod) {
			if ((n & 1) != 0) {
				res = (int) (res * p % mod);
			}
		}
		return res;
	}
	
		public static  class DisjointSetsRank {

    	int[] p;
    	int[] rank;

    	public DisjointSetsRank(int size) {
    		p = new int[size];
    		for (int i = 0; i < size; i++)
    			p[i] = i;
    		rank = new int[size];
    	}

    	public int root(int x) {
    		return x == p[x] ? x : (p[x] = root(p[x]));
    	}
    	public int sameSet(int x,int y){
    		if(root(x)==root(y))
    			return 1;
    		return 0;
    					
    	}
    	public void unite(int a, int b) {
    		a = root(a);
    		b = root(b);
    		if (a == b)
    			return;

    		if (rank[a] < rank[b]) {
    			p[a] = b;
    		} else {
    			p[b] = a;
    			if (rank[a] == rank[b])
    				++rank[a];
    		}
    	}

    	public static void main(String[] args) {
    		DisjointSetsRank ds = new DisjointSetsRank(10);
    		System.out.println(false == (ds.root(0) == ds.root(9)));
    		ds.unite(0, 9);
    		System.out.println(true == (ds.root(0) == ds.root(9)));
    	}
    }
    static int gcd (long m, long n){
        long x;
        long y;
        while(m%n != 0){
            x = n;
            y = m%n;
            m = x;
            n = y;
        }
        return (int) n;
    }
    public static class st {
    	
	    int n;
	    long[] val;
	    int[] index;
	    void build(long [] t) {  // build the tree
	       this.n=t.length;
	       val = new long[2*n];
	       index = new int[2*n];
	       
	       for(int i=0;i<n;i++){
	    	   val[n+i] = t[i];
	    	   index[n+i] = i;
	       }
	       for(int i=n-1;i>=0;i--){
	    	   if(val[2*i]>val[2*i+1]){
	    		   val[i] = val[2*i];
	    		   index[i]= index[2*i];
	    	   }
	    	   else{
	    		   val[i] = val[2*i+1];
	    		   index[i]= index[2*i+1];
	    	   }
	       }
	    }
	    
	    int query(int l, int r) {  // sum on interval [l, r)
	    	int res=0;
	    	long max=0;
	    	for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
	    		if ((l&1)!=0) {
	    			if(val[l]>max){
	    				max=val[l];
	    				res = index[l];
	    			}
	    			l++;
	    		}
	            if ((r&1)!=0){
	            	--r;
	            	if(val[r]>max){
	    				max=val[r];
	    				res = index[r];
	    			}
	            }
	        }
	    	return res;
	    }
	}
    public static class FasterScanner {
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = System.in.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextLine() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public String nextString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
          
        public int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }
      
        public long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }
    }
}