#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, i, j, k;
  cin >> n >> k;
  int a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  if (k == 1 && a[0] != a[1]) {
    cout << "1 1";
    return 0;
  }
  map<int, int> mp;
  int st = 1, en = 1;
  i = 0;
  j = 1;
  mp[a[i]]++;
  while (j < n) {
    mp[a[j]]++;
    if (mp.size() <= k) {
      if (j - i > en - st) {
        st = i;
        en = j;
      }
    } else if (mp.size() > k) {
      if (mp[a[i]] == 1)
        mp.erase(a[i]);
      else
        mp[a[i]]--;
      i++;
    }
    j++;
  }
  cout << st + 1 << " " << en + 1 << "\n";
}
