#include <bits/stdc++.h>
using namespace std;
using namespace std;
int arr[500011];
vector<long long> v;
map<int, int> m;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, k, cnt = 0, start = 0, a = 0, b = 0, end, mx = -1;
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> arr[i];
  for (int i = 0; i < n; i++) {
    if (cnt < k) {
      if (m[arr[i]] > 0) {
        m[arr[i]]++;
        b++;
      } else {
        m[arr[i]]++;
        cnt++;
        b++;
      }
    } else if (cnt == k && m[arr[i]] > 0) {
      m[arr[i]]++;
      b++;
    } else {
      while (cnt >= k) {
        if (m[arr[a]] > 1) {
          m[arr[a]]--;
          a++;
        } else if (m[arr[a]] == 1) {
          m[arr[a]]--;
          a++;
          cnt--;
        }
      }
      i--;
    }
    if (b - a > mx) {
      start = a;
      end = b;
      mx = b - a;
    }
  }
  cout << start + 1 << " " << end << endl;
}
