#include <bits/stdc++.h>
using namespace std;
int n, k, v[1000005], a[500005];
int main() {
  cin >> n >> k;
  int j = 1, sol = 1, d = 0, x = 1, y = 1;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (v[a[i]] == 0) d++;
    v[a[i]]++;
    while (d > k) {
      v[a[j]]--;
      if (v[a[j]] == 0) d--;
      j++;
    }
    if (i - j + 1 > sol) {
      sol = i - j + 1;
      x = j;
      y = i;
    }
  }
  cout << x << ' ' << y << '\n';
  return 0;
}
