#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000100;
int n, k, L, R, a[maxn], cnt[maxn];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int l = 0, r = -1; l < n;) {
    for (; (cnt[a[r + 1]] or k) and r < n - 1;)
      r++, cnt[a[r]]++, k -= (cnt[a[r]] == 1);
    if (r - l > R - L) L = l, R = r;
    cnt[a[l]]--;
    k += (cnt[a[l]] == 0);
    l++;
  }
  cout << L + 1 << " " << R + 1 << endl;
  return 0;
}
