#include <bits/stdc++.h>
int brojevi[1000000] = {0};
int main() {
  int a[500002];
  int tmp, n, k, i, j, razliciti = 0;
  int max_i = 0, max_j = 0, max_diff = 0;
  scanf("%d %d", &n, &k);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  i = 0;
  j = 0;
  while (j < n) {
    if (brojevi[a[j]]) {
      brojevi[a[j]]++;
    } else {
      brojevi[a[j]] = 1;
      razliciti++;
      while (razliciti > k) {
        if (brojevi[a[i]] == 1) {
          brojevi[a[i]] = 0;
          razliciti--;
          i++;
        } else {
          brojevi[a[i]]--;
          i++;
        }
      }
    }
    if (max_diff < j - i + 1) {
      max_diff = j - i + 1;
      max_i = i;
      max_j = j;
    }
    j++;
  }
  printf("%d %d\n", max_i + 1, max_j + 1);
  return 0;
}
