#include <bits/stdc++.h>
using namespace std;
bool comp(int a, int b) { return (a > b); }
int gcd(long long int a, long long int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int m[1000001];
int main(void) {
  ios::sync_with_stdio(0);
  int n, k;
  cin >> n >> k;
  int i, a[n], j = 0, l, r, c = 0, ma = 0;
  for (i = 0; i < n; ++i) cin >> a[i];
  for (i = 0; i < n; ++i) {
    if (!m[a[i]]) c++;
    m[a[i]]++;
    if (c > k) {
      if (ma < (i - j)) {
        ma = i - j;
        l = j + 1;
        r = i;
      }
      while (c > k) {
        m[a[j]]--;
        if (m[a[j]] == 0) c--;
        j++;
      }
    }
  }
  if (ma < i - j) {
    l = j + 1;
    r = i;
  }
  cout << l << " " << r;
  return 0;
}
