#include <bits/stdc++.h>
using namespace std;
template <typename T>
using V = vector<T>;
const double Pi = acos(-1.0);
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  int n, k;
  cin >> n >> k;
  vector<int> xs(n);
  for (int i = 0; i < int(n); i++) cin >> xs[i];
  int left = 0, best = 0;
  int curleft = 0, curlen = 0;
  map<int, int> mp;
  for (int i = 0; i < int(n); i++) {
    int a = xs[i];
    mp[a]++;
    curlen++;
    while (mp.size() > k) {
      if (--mp[xs[curleft]] == 0) {
        mp.erase(xs[curleft]);
      }
      curlen--;
      curleft++;
    }
    if (curlen > best) {
      best = curlen;
      left = curleft;
    }
  }
  cout << left + 1 << ' ' << left + best << endl;
}
