#include <bits/stdc++.h>
using namespace std;
void Suhaib_Sawalha() {
  int n, k;
  cin >> n >> k;
  int a[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  pair<int, int> ans;
  int longest = 0, l = 0, r = 0;
  map<int, int> m;
  m[a[0]]++;
  while (r < n) {
    if (m.size() <= k) {
      if (r - l + 1 > longest) {
        longest = r - l + 1;
        ans = {l + 1, r + 1};
      }
      r++;
      m[a[r]]++;
    } else {
      m[a[l]]--;
      if (!m[a[l]]) m.erase(a[l]);
      l++;
    }
  }
  cout << ans.first << ' ' << ans.second;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int _;
  Suhaib_Sawalha();
  return 0;
}
