#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
map<int, int> m;
int a[500005];
int main() {
  ios::sync_with_stdio(false);
  int n, k;
  scanf("%d", &(n));
  scanf("%d", &(k));
  int l = 1, lp = 1, rp = 1;
  for (int i = (1); i <= (n); i++) scanf("%d", &(a[i]));
  int ans = 0;
  for (int i = (1); i <= (n); i++) {
    m[a[i]]++;
    if (m.size() > k) {
      if (m[a[l]] == 1)
        m.erase(a[l]);
      else
        m[a[l]]--;
      l++;
    }
    if (i - l + 1 > ans) ans = i - l + 1, lp = l, rp = i;
  }
  cout << lp << " " << rp << endl;
  return 0;
}
