#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  scanf("%d", &n);
  scanf("%d", &k);
  int a[n];
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  set<int> s;
  map<int, int> m;
  int len = 0;
  int resl, resr;
  int l = 0;
  for (int r = 0; r < n; r++) {
    if (s.find(a[r]) != s.end())
      m[a[r]]++;
    else {
      s.insert(a[r]);
      m[a[r]] = 1;
    }
    while (s.size() > k) {
      if (m[a[l]] == 1)
        s.erase(a[l]);
      else
        m[a[l]]--;
      l++;
    }
    if (r - l + 1 > len) {
      len = r - l + 1;
      resl = l + 1;
      resr = r + 1;
    }
  }
  printf("%d %d", resl, resr);
}
