#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  map<int, int> s;
  int best = -1;
  int left = -1, right = -1;
  int pos = 0;
  for (int i = 0; i < n; ++i) {
    auto it0 = s.find(a[i]);
    if (it0 != s.end()) {
      it0->second += 1;
    } else {
      s[a[i]] = 1;
    }
    int d = s.size();
    while (d > k) {
      auto it1 = s.find(a[pos]);
      if (it1->second > 1) {
        it1->second -= 1;
      } else {
        s.erase(it1);
      }
      d = s.size();
      ++pos;
    }
    if (i - pos > best) {
      left = pos;
      right = i;
      best = i - pos;
    }
  }
  printf("%d %d\n", left + 1, right + 1);
  return 0;
}
