#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long a = 0, b = getchar(), c = 1;
  while (!isdigit(b)) c = b == '-' ? -1 : 1, b = getchar();
  while (isdigit(b)) a = a * 10 + b - '0', b = getchar();
  return a * c;
}
int n, k, ans, sum, res, ret, x, a[500005], b[1000005];
int main() {
  n = read(), k = read();
  for (int i = 0; i < n; i++) a[i] = read();
  for (int i = 0; i < n; i++) {
    if (i != 0) b[a[i - 1]]--, sum -= b[a[i - 1]] == 0;
    while (sum <= k and x < n) {
      if (sum == k and b[a[x]] == 0) break;
      sum += b[a[x]] == 0, b[a[x]]++, x++;
    }
    if (x - i > ans) ans = x - i, res = i + 1, ret = x;
  }
  printf("%d %d", res, ret);
  return 0;
}
