#include <bits/stdc++.h>
using namespace std;
const int mx = 5 * 1e5 + 100;
const int mn = 1e6 + 100;
int v[mx];
int u[mn];
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  for (int i = 0, _ = n; i < _; i++) {
    scanf("%d", &v[i]);
  }
  int x = 0, l = 0, d = 0, ansl = 0, ansr = 0;
  for (int i = 0, _ = n; i < _; i++) {
    if (!u[v[i]]) x++;
    u[v[i]]++;
    while (x > k) {
      u[v[l]]--;
      if (!u[v[l]]) x--;
      l++;
    }
    if (d < i - l + 1) {
      d = i - l + 1;
      ansl = l;
      ansr = i;
    }
  }
  printf("%d %d\n", ansl + 1, ansr + 1);
}
