#include <bits/stdc++.h>
using namespace std;
int main() {
  int freq[1000100] = {};
  int n, k, num[600100];
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> num[i];
  freq[num[1]]++;
  int ndif = 1, maxlen = 1;
  int l = 1, r = 1;
  int ansl = 1, ansr = 1;
  while (r < n) {
    if (ndif <= k) {
      r++;
      if (freq[num[r]] == 0) ndif++;
      freq[num[r]]++;
    } else {
      l++;
      if (freq[num[l - 1]] == 1) ndif--;
      freq[num[l - 1]]--;
    }
    if (ndif <= k && r - l + 1 > maxlen) {
      maxlen = r - l + 1;
      ansl = l;
      ansr = r;
    }
  }
  cout << ansl << " " << ansr << endl;
  return 0;
}
