#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, k, a[500000], i, j, r, l = 0, max = 0, lans, rans;
  map<long, long> m;
  scanf("%ld%ld", &n, &k);
  for (r = 0; r < n; r++) scanf("%ld", &a[r]);
  max = 0;
  for (r = 0; r < n; r++) {
    m[a[r]]++;
    if (m.size() > k) {
      m[a[l]]--;
      if (m[a[l]] == 0) m.erase(a[l]);
      l++;
    }
    if (r - l + 1 > max) {
      max = r - l + 1;
      lans = l + 1;
      rans = r + 1;
    }
  }
  cout << lans << " " << rans << endl;
}
