#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 10;
int vis[(int)1e6 + 10];
int a[maxn];
int n, k, l, r;
int maxl, maxr;
int main() {
  scanf("%d%d", &n, &k);
  int cur = 1;
  maxl = 1;
  maxr = 1;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  int l = 1;
  vis[a[1]] = 1;
  int maxlen = 0;
  for (int r = 2; r <= n; r++) {
    if (!vis[a[r]]) {
      cur++;
    }
    vis[a[r]]++;
    if (cur > k) {
      while (vis[a[l]] > 0) {
        vis[a[l]]--;
        if (vis[a[l]] == 0) {
          cur--;
          l++;
          break;
        }
        l++;
      }
    }
    if (r - l > maxlen) {
      maxlen = r - l;
      maxl = l;
      maxr = r;
    }
  }
  printf("%d %d\n", maxl, maxr);
  return 0;
}
