#include <bits/stdc++.h>
using namespace std;
int a[500010];
int op[1000010] = {0};
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int j = 1;
  int l = 1, r = 1, num = 0;
  for (int i = 1; i <= n; i++) {
    op[a[i]]++;
    if (op[a[i]] == 1) num++;
    while (num > k) {
      op[a[j]]--;
      if (op[a[j]] == 0) num--;
      j++;
    }
    if (r - l < i - j) {
      l = j;
      r = i;
    }
  }
  cout << l << ' ' << r << endl;
  return 0;
}
