#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int arr[n], pos1, pos2, mx = 0;
  for (int i = 0; i < n; i++) cin >> arr[i];
  map<int, int> mp;
  for (int i = 0, j = 0; i < n; i++) {
    mp[arr[i]]++;
    if (mp.size() > k) {
      mp[arr[j]]--;
      if (mp[arr[j]] == 0) mp.erase(arr[j]);
      j++;
    }
    if (mx < i - j + 1) {
      mx = i - j + 1;
      pos1 = j;
      pos2 = i;
    }
  }
  cout << pos1 + 1 << " " << pos2 + 1 << endl;
  return 0;
}
