#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
int a[500000];
int used[1000005];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  int start = 1, end = 0, j = 0, diffs = 0;
  for (int i = 0; i < n; ++i) {
    if (diffs != k) {
      for (; j < n; ++j) {
        if (diffs == k && !used[a[j]]) break;
        if (!used[a[j]]) {
          diffs++;
        }
        used[a[j]]++;
      }
    }
    if (end - start < (j - 1) - i) {
      end = j - 1;
      start = i;
    }
    used[a[i]]--;
    if (!used[a[i]]) {
      diffs--;
    }
  }
  printf("%d %d\n", start + 1, end + 1);
  return 0;
}
