#include <bits/stdc++.h>
using namespace std;
map<long long, long long> ar;
map<long long, long long> global;
int main() {
  long long a, i, p, seg, ma = 0, l = 1, r = 1, ch = 0;
  cin >> a >> seg;
  for (i = 1; i <= a; i++) {
    scanf("%lld", &p);
    ar[i] = p;
  }
  long long left = 1, co = 0;
  for (i = 1; i <= a; i++) {
    if (a == 1 || i > a) break;
    p = ar[i];
    global[p]++;
    if (global[p] == 1) co++;
    long long p = global[ar[i + 1]];
    if (p + 1 == 1 && co + 1 > seg) {
      if ((i - left) + 1 > ma) {
        ma = (i - left) + 1;
        ch = 1;
        l = left;
        r = i;
      }
      while (1) {
        p = ar[left];
        global[p]--;
        left++;
        if (global[p] == 0) break;
      }
    }
  }
  if (i > a) i = i - 1;
  if ((i - left) + 1 > ma && co == seg) {
    l = left;
    r = i;
    ma = (i - left) + 1;
    ch = 1;
  }
  if (a == 1 && seg == 1) {
    cout << 1 << " " << 1 << "\n";
  } else if (ch == 1) {
    cout << l << " " << r << "\n";
  } else
    cout << 1 << " " << a << "\n";
}
