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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
map<int, int> mp1;
map<int, int> mp2;
int n;
vector<int> arr;
vector<int> first;
int nxt[500100];
int s[2000400];
vector<pair<int, pair<int, int> > > qs;
vector<pair<int, int> > ans;
void build(int id = 1, int l = 0, int r = n) {
  if (r - l < 2) {
    s[id] = first[l];
    return;
  }
  int mid = (l + r) / 2;
  build(id * 2, l, mid);
  build(id * 2 + 1, mid, r);
  s[id] = s[id * 2] + s[id * 2 + 1];
}
void modify(int p, int x, int id = 1, int l = 0, int r = n) {
  s[id] += x - first[p];
  if (r - l < 2) {
    first[p] = x;
    return;
  }
  int mid = (l + r) / 2;
  if (p < mid)
    modify(p, x, id * 2, l, mid);
  else
    modify(p, x, id * 2 + 1, mid, r);
}
int sum(int x, int y, int id = 1, int l = 0, int r = n) {
  if (x >= r or l >= y) return 0;
  if (x <= l && r <= y) return s[id];
  int mid = (l + r) / 2;
  return sum(x, y, id * 2, l, mid) + sum(x, y, id * 2 + 1, mid, r);
}
int main(int argc, char** argv) {
  int k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    arr.push_back(x);
    if (mp1.find(x) == mp1.end())
      first.push_back(1);
    else
      first.push_back(0);
    mp1[x]++;
  }
  for (int i = n - 1; i >= 0; i--) {
    if (mp2.find(arr[i]) == mp2.end())
      nxt[i] = i;
    else
      nxt[i] = mp2[arr[i]];
    mp2[arr[i]] = i;
  }
  build();
  int l = 0;
  int r = 0;
  int bl, br = 0;
  int best = 0;
  int current = 0;
  while (r <= n && l <= r) {
    while (current <= k && r <= n) {
      r++;
      current = sum(l, r);
    }
    r--;
    if (r - l > best) {
      bl = l;
      br = r;
      best = r - l;
    }
    while (current >= k && l < r) {
      modify(nxt[l], 1);
      l++;
      current = sum(l, r);
    }
    if (r == n) break;
  }
  cout << bl + 1 << " " << br << endl;
  return 0;
}