#include <bits/stdc++.h>
using namespace std;
int a[500009], n, k, i, cnt, p, has[1000009], ansl, ansr, ma = 0;
int main() {
  cin >> n >> k;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
  }
  p = 1, cnt = 0;
  for (i = 1; i <= n & cnt < k; i++) {
    if (has[a[i]] == 0) cnt++;
    has[a[i]]++;
  }
  ma = i - p - 1;
  ansl = 1;
  ansr = i - 1;
  i--;
  for (; i <= n;) {
    if (cnt == k + 1) {
      has[a[p]]--;
      if (has[a[p]] == 0) {
        cnt--;
      }
      p++;
      if (i - p > ma && cnt == k) {
        ma = i - p;
        ansl = p, ansr = i;
      }
    } else {
      i++;
      if (has[a[i]] == 0) {
        cnt++;
      }
      has[a[i]]++;
      if (i - p > ma && cnt == k) {
        ma = i - p;
        ansl = p, ansr = i;
      }
    }
    if (i - p > ma && cnt == k) {
      ma = i - p;
      ansl = p, ansr = i;
    }
  }
  cout << ansl << " " << min(ansr, n);
}
