#include <bits/stdc++.h>
using namespace std;
int a1[1000001];
int main(void) {
  int n, k;
  cin >> n >> k;
  int *a = new int[n];
  int c = 0, p = 0, l = 0, r = -55, c2 = 0, mx = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n;) {
    if (a1[a[i]] == 0 && c == k) {
      if (c2 > mx) {
        mx = c2;
        l = p;
        r = i - 1;
      }
      a1[a[p]]--;
      if (a1[a[p]] == 0) {
        c--;
      }
      p++;
      c2--;
    } else {
      c2++;
      a1[a[i]]++;
      if (a1[a[i]] == 1) c++;
      i++;
    }
  }
  if (c2 > mx) {
    r = n - 1;
    if (l + 1 != 0) l = p;
  }
  cout << (l + 1) << " " << (r + 1);
}
