#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, k, i, j, begin, count, l = 0, r = 0;
  cin >> n >> k;
  map<long long int, long long int> m;
  long long int a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  begin = 0;
  count = 1;
  m[a[0]] = 1;
  j = 1;
  while (j < n) {
    m[a[j]]++;
    if (m[a[j]] == 1) count++;
    if (count > k) {
      i = begin;
      while (i <= j && m[a[i]] > 1) {
        m[a[i]]--;
        i++;
      }
      m[a[i]]--;
      begin = i + 1;
      count -= 1;
      j++;
      continue;
    }
    if (j - begin > r - l) {
      r = j;
      l = begin;
    }
    j++;
  }
  cout << l + 1 << " " << r + 1;
  return 0;
}
