#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, k;
  scanf("%lli%lli", &n, &k);
  long long arr[n];
  for (long long i = 0; i < n; i++) scanf("%lli", &arr[i]);
  long long start = 0, end = 0;
  long long max_length = 0;
  long long ans_start = -1, ans_end = -1;
  map<long long, long long> hm;
  long long count = 0;
  while (end < n) {
    hm[arr[end]]++;
    if (hm[arr[end]] == 1) count++;
    while (count > k) {
      hm[arr[start]]--;
      if (hm[arr[start]] == 0) count--;
      start++;
    }
    long long length = end - start + 1;
    if (length > max_length) {
      max_length = length;
      ans_start = start;
      ans_end = end;
    }
    end++;
  }
  printf("%lli %lli", ans_start + 1, ans_end + 1);
  return 0;
}
