#include <bits/stdc++.h>
using namespace std;
int n, k, a[500500], mx = -1, l, r, mp[1000100];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; ++i) scanf("%d", a + i);
  int i = 0, j = 0, c = 0;
  while (j < n) {
    if (mp[a[j]] == 0) ++c;
    mp[a[j]]++;
    if (c > k) {
      while (c > k && i <= j) {
        mp[a[i]]--;
        if (mp[a[i]] == 0) --c;
        ++i;
      }
    }
    if (j - i > mx) {
      l = i + 1, r = j + 1;
      mx = j - i;
    }
    ++j;
  }
  printf("%d %d", l, r);
  return 0;
}
