#include <bits/stdc++.h>
int v[500005];
int got[1000005];
int main(void) {
  int n, k;
  scanf(" %d %d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf(" %d", &v[i]);
  }
  for (int i = 0; i < 1000005; i++) {
    got[i] = 0;
  }
  int l = 0;
  int r = -1;
  int bl = 0;
  int br = 0;
  int big = 0;
  int in = 0;
  while (l < n) {
    if (r < l) {
      r++;
      int x = v[r];
      if (got[x] == 0) {
        in++;
      }
      got[x]++;
    } else {
      if (in <= k && r < n - 1) {
        r++;
        int x = v[r];
        if (got[x] == 0) {
          in++;
        }
        got[x]++;
      } else {
        int x = v[l];
        if (got[x] == 1) {
          in--;
        }
        got[x]--;
        l++;
      }
    }
    if (in <= k && r - l + 1 > big) {
      big = r - l + 1;
      br = r;
      bl = l;
    }
  }
  printf("%d %d\n", bl + 1, br + 1);
  return 0;
}
