#include <bits/stdc++.h>
using namespace std;
const int siz = 10 + 1e6;
const int siz1 = 5e5 + 10;
int f[siz], a[siz1], n, k, len, L, R;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  int l = 0, r = 0, cnt = 0;
  while (r < n) {
    if (f[a[r]] == 0) cnt++;
    f[a[r]]++;
    if (cnt <= k)
      if (len < r - l + 1) {
        L = l;
        R = r;
        len = r - l + 1;
      }
    while (cnt > k) {
      f[a[l]]--;
      if (f[a[l]] == 0) cnt--;
      l++;
    }
    r++;
  }
  printf("%d %d", ++L, ++R);
  return 0;
}
