#include <bits/stdc++.h>
using namespace std;
const int N = 500001, M = 1000001;
int a[N], b[M];
int main() {
  ios_base::sync_with_stdio(0);
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  memset(b, 0, sizeof b);
  int start = 0, end = 0, startb = start, endb = end, cnt = 1;
  b[a[0]] = 1;
  for (int i = 1; i < n; i++) {
    if ((cnt == k && b[a[i]] != 0) || cnt < k) {
      if (b[a[i]] == 0) cnt++;
      b[a[i]]++;
      end++;
    } else {
      if (end - start > endb - startb) {
        endb = end;
        startb = start;
      }
      if (b[a[start]] == 1) cnt--;
      b[a[start]]--;
      start += 1;
      i--;
    }
  }
  if (end - start > endb - startb) {
    endb = end;
    startb = start;
  }
  cout << startb + 1 << " " << endb + 1 << "\n";
}
