#include <bits/stdc++.h>
using namespace std;
void init() {
  cin.tie(0);
  cin.sync_with_stdio(0);
}
int fr[int(1e6) + 1];
int main() {
  init();
  int n, k;
  cin >> n >> k;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  int l = 0, r = 0, distinct = 0, ans = 0, ansl = 0, ansr = 0;
  while (r < n) {
    if (!fr[arr[r]]) distinct++;
    fr[arr[r]]++;
    while (distinct > k) {
      fr[arr[l]]--;
      if (!fr[arr[l]]) distinct--;
      l++;
    }
    if (r - l + 1 > ans) {
      ans = r - l + 1;
      ansl = l + 1;
      ansr = r + 1;
    }
    r++;
  }
  cout << ansl << " " << ansr;
}
