#include <bits/stdc++.h>
using namespace std;
void faster() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
const int N = 5e5;
int n, a[N], cnt, k, ans_l, ans_r, l, r;
map<int, int> mp;
int main() {
  faster();
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  ans_l = 1;
  while (r != n) {
    if (!mp[a[r]] && cnt < k)
      cnt++;
    else if (!mp[a[r]]) {
      while (cnt == k) {
        if (mp[a[l]] == 1) cnt--;
        mp[a[l++]]--;
      }
      cnt++;
    }
    mp[a[r]]++;
    if (ans_r - ans_l + 1 < r - l + 1) ans_l = l, ans_r = r;
    r++;
  }
  cout << ans_l + 1 << " " << ans_r + 1 << endl;
}
