#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
int a[N];
int st[N * 10];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  int cnt = 0;
  int l = 0, r = 0;
  int dist = 0;
  for (int i = 0, j = 0; i < n; i++) {
    if (!st[a[i]]) {
      st[a[i]]++;
      cnt++;
    } else
      st[a[i]]++;
    while (cnt > k) {
      st[a[j]]--;
      if (!st[a[j]]) cnt--;
      j++;
    }
    if (i - j + 1 > dist) {
      dist = i - j + 1;
      l = j, r = i;
    }
  }
  cout << l + 1 << ' ' << r + 1 << endl;
  return 0;
}
