#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 9;
void get_input(int &n, int &k, vector<int> &num) {
  cin >> n >> k;
  num.resize(n);
  for (int i = 0; i < n; ++i) cin >> num[i];
}
int main() {
  int n, k;
  vector<int> num;
  get_input(n, k, num);
  vector<int> cnt(N, 0);
  cnt[num[0]]++;
  int counter = 1, ans = 1;
  int ans_l = 0, ans_r = 0;
  int r = 0;
  for (int l = 0; l < n; ++l) {
    while (r < (n - 1) && (counter < k || cnt[num[r + 1]] != 0)) {
      int try_add = num[r + 1];
      if (cnt[try_add] == 0) counter++;
      cnt[try_add]++;
      r++;
    }
    if (r - l + 1 > ans) {
      ans = r - l + 1;
      ans_l = l;
      ans_r = r;
    }
    int try_del = num[l];
    cnt[try_del]--;
    if (cnt[try_del] == 0) counter--;
  }
  cout << ans_l + 1 << ' ' << ans_r + 1;
  return 0;
}
