#include <bits/stdc++.h>
using namespace std;
int x[200010], m, p, q;
long long s[200010], a[200010], A[200010], b[200010], B[200010], C[200010];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &x[i]);
  for (int i = 1; i <= n; i++) s[i] = s[i - 1] + x[i];
  for (int i = k; i <= n - k; i++) a[i] = s[i] - s[i - k];
  for (int i = k + 1; i <= n - k + 1; i++) b[i] = s[i + k - 1] - s[i - 1];
  A[k] = a[k];
  for (int i = k + 1; i <= n - k; i++) A[i] = max(A[i - 1], a[i]);
  B[n - k + 1] = b[n - k + 1];
  for (int i = n - k; i >= (k + 1); i--) B[i] = max(B[i + 1], b[i]);
  for (int i = k; i <= n - k; i++) C[i] = A[i] + B[i + 1];
  long long ans = 0;
  for (int i = k; i <= n - k; i++) ans = max(ans, C[i]);
  for (int i = k; i <= n - k; i++) {
    if (C[i] == ans) {
      m = i;
      break;
    }
  }
  for (int i = k; i <= m; i++) {
    if (a[i] == A[m]) {
      p = i;
      break;
    }
  }
  for (int j = m + 1; j <= n - k + 1; j++) {
    if (b[j] == B[m + 1]) {
      q = j;
      break;
    }
  }
  printf("%d %d", p - k + 1, q);
  return 0;
}
