#include <bits/stdc++.h>
using namespace std;
int a[1000010];
map<int, int> ma;
int main() {
  int ansl, ansr, l, r, i, j, k, n, ans = 0;
  scanf("%d%d", &n, &k);
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  int size = 0;
  l = 1;
  for (i = 1; i <= n; i++) {
    if (ma[a[i]] == 0) size++;
    ma[a[i]]++;
    while (size > k) {
      if (ma[a[l]] == 1) size--;
      ma[a[l]]--;
      l++;
    }
    if (i - l + 1 > ans) {
      ans = i - l + 1;
      ansl = l;
      ansr = i;
    }
  }
  printf("%d %d\n", ansl, ansr);
  return 0;
}
