#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  int a[n + 1];
  int ac = 1, b = 1, nd = 1, start = 1;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  map<int, int> m;
  for (int nd = 1; nd <= n; nd++) {
    m[a[nd]]++;
    while (m.size() > k) {
      m[a[start]]--;
      if (m[a[start]] == 0) m.erase(a[start]);
      start++;
    }
    if ((nd - start) > (b - ac)) ac = start, b = nd;
  }
  printf("%d %d\n", ac, b);
  return 0;
}
