#include <bits/stdc++.h>
using namespace std;
void solve();
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
}
int const MAX = 1e6 + 7;
int cnt[MAX];
void solve() {
  int n, k;
  cin >> n >> k;
  int val[n];
  for (int i = 0; i < n; i++) cin >> val[i];
  int x, y;
  int ans = 0;
  int l = 0;
  int diff = 0;
  for (int r = 0; r < n; r++) {
    if (++cnt[val[r]] == 1) {
      diff++;
    }
    while (diff > k) {
      if (--cnt[val[l]] == 0) diff--;
      l++;
    }
    if (r - l + 1 > ans) {
      ans = r - l + 1;
      x = l;
      y = r;
    }
  }
  cout << x + 1 << " " << y + 1 << endl;
}
