#include <bits/stdc++.h>
int N, K;
long long a[200010];
long long s[200010];
long long m[200010];
long long midx[200010];
int main() {
  scanf("%d%d", &N, &K);
  for (int i = 0; i < N; i++) scanf("%I64d", &a[i]);
  long long t = 0;
  for (int i = 0; i < K; i++) t += a[i];
  for (int i = 0; i + K <= N; i++) {
    s[i] = t;
    t = t + a[i + K] - a[i];
  }
  for (int i = N - K; i >= 0; i--) {
    if (m[i + 1] > s[i]) {
      m[i] = m[i + 1];
      midx[i] = midx[i + 1];
    } else {
      m[i] = s[i];
      midx[i] = i;
    }
  }
  long long best = 0ll;
  int besta, bestb;
  for (int i = 0; i + K + K <= N; i++) {
    if (s[i] + m[i + K] > best) {
      best = s[i] + m[i + K];
      besta = i;
      bestb = midx[i + K];
    }
  }
  printf("%d %d\n", besta + 1, bestb + 1);
}
