#include <bits/stdc++.h>
using namespace std;
int a[500005], ck[1000006], ans[500005], yo, cnt, k, n;
int x, y;
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < n; i++) {
    if (!ck[a[i]]) {
      cnt++;
      if (cnt > k) {
        cnt--;
        ck[a[yo]]--;
        if (!ck[a[yo]]) cnt--;
        yo++;
        i--;
        continue;
      }
    }
    ck[a[i]]++;
    ans[yo] = i;
  }
  int mx = -1;
  for (int i = 0; i < n; i++) {
    int d = ans[i] - i;
    if (d > mx) x = i + 1, y = ans[i] + 1, mx = d;
  }
  printf("%d %d", x, y);
  return 0;
}
