#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
int n, k, a[N], fr[1234567];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; ++i) {
    scanf("%d", a + i);
  }
  int diff = 0, l = 1, r = 1, MxDiff = 0, last = -1;
  for (int i = 0, j = 0; j < n;) {
    if (fr[a[j]] == 0) diff++;
    if (last != j) fr[a[j]]++;
    last = j;
    if (diff > k) {
      fr[a[i]]--;
      if (fr[a[i]] == 0) diff--;
      i++;
    } else {
      if (MxDiff < j - i + 1) {
        l = i + 1;
        r = j + 1;
        MxDiff = j - i + 1;
      }
      ++j;
    }
  }
  printf("%d %d", l, r);
  return 0;
}
