#include <bits/stdc++.h>
using namespace std;
bool sortinrev(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.first > b.first);
}
struct greaterr {
  template <class T>
  bool operator()(T const &a, T const &b) const {
    return a > b;
  }
};
int main() {
  std::ios::sync_with_stdio(false);
  int n, k;
  int cnt[1000010] = {0};
  cin >> n >> k;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int l = 0;
  int maxc = 0, maxdiff = 0, maxl = 0, maxr = 0;
  for (int r = 0; r < n; r++) {
    cnt[a[r]]++;
    if (cnt[a[r]] == 1) maxc++;
    while (maxc > k) {
      cnt[a[l]]--;
      if (cnt[a[l]] == 0) maxc--;
      l++;
    }
    if (r - l >= maxdiff) {
      maxdiff = r - l;
      maxr = r;
      maxl = l;
    }
  }
  cout << maxl + 1 << " " << maxr + 1 << "\n";
  return 0;
}
