#include <bits/stdc++.h>
using namespace std;
int uniq = 0;
int c[1000005];
int a[1000005];
int main() {
  int n, k, i, j = 0, x, y;
  scanf("%d %d", &n, &k);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  i = 0;
  j = 0;
  c[a[0]]++;
  uniq = 1;
  int len = 0, ax, ay;
  while (i < n && j < n) {
    if (uniq <= k) {
      j++;
      x = a[j];
      if (c[x] == 0) uniq++;
      c[x]++;
    } else {
      x = a[i++];
      c[x]--;
      if (c[x] == 0) uniq--;
    }
    if ((j - i) > len) {
      ax = j, ay = i + 1;
      len = j - i;
    }
  }
  cout << ay << " " << ax << endl;
}
