#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 6;
int ara[N];
int fre[N];
int l, r, i, j, cnt, len;
int main() {
  int n, m;
  cin >> n >> m;
  for (i = 0; i < n; i++) cin >> ara[i];
  for (int i = 0; i < n; i++) {
    fre[ara[i]]++;
    if (fre[ara[i]] == 1) cnt++;
    while (cnt > m) {
      fre[ara[j]]--;
      if (fre[ara[j]] == 0) cnt--;
      j++;
    }
    if (i - j > len) {
      len = i - j;
      r = i;
      l = j;
    }
  }
  cout << l + 1 << " " << r + 1 << endl;
}
