#include <bits/stdc++.h>
using namespace std;
int freq[1000005] = {};
int n, k;
vector<int> number;
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    int num;
    cin >> num;
    number.push_back(num);
  }
  int def = 0, sumofNumebr = 0;
  int l1 = 0, r1 = 0;
  for (int i = 0, j = 0; i < n; i++) {
    while (sumofNumebr > k && j < i) {
      freq[number[j]]--;
      if (freq[number[j]] == 0) sumofNumebr--;
      j++;
    }
    freq[number[i]]++;
    if (freq[number[i]] == 1) sumofNumebr++;
    if (sumofNumebr <= k && (i - j > def)) {
      l1 = j, r1 = i, def = i - j;
    }
  }
  cout << l1 + 1 << " " << r1 + 1 << endl;
  return 0;
}
