#include <bits/stdc++.h>
using namespace std;
const int maxN = 1e6 + 13;
int n, k, a[maxN], cur, st, en, ans, cnt[maxN];
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  int r = -1;
  for (int i = 0; i < n; i++) {
    if (i) {
      cnt[a[i - 1]]--;
      if (cnt[a[i - 1]] == 0) cur--;
    }
    while (cur <= k && r < n) {
      r++;
      cnt[a[r]]++;
      if (cnt[a[r]] == 1) cur++;
    }
    if (r - i > ans) {
      ans = r - i;
      st = i + 1, en = r;
    }
  }
  cout << st << " " << en << endl;
}
