#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f, mod = 1000000007;
const double pi = 3.1415926535897932, eps = 1e-6;
int n, k, a[500005], t[1000005], r, cnt, ans, s1, s2;
int main() {
  scanf("%d%d", &n, &k);
  for (int(i) = (1); (i) <= (n); (i)++) scanf("%d", a + i);
  r = 0;
  for (int(i) = (1); (i) <= (n); (i)++) {
    if (i > 1) {
      t[a[i - 1]]--;
      if (t[a[i - 1]] == 0) cnt--;
    }
    while (cnt <= k && r < n) {
      r++;
      if (t[a[r]] == 0) cnt++;
      t[a[r]]++;
    }
    if (cnt > k) {
      t[a[r]]--;
      if (t[a[r]] == 0) cnt--;
      r--;
    }
    if (ans < r - i + 1) ans = r - i + 1, s1 = i, s2 = r;
  }
  printf("%d %d\n", s1, s2);
  return 0;
}
