#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100100;
int a[2 * MAX_N], n, k;
long long sum[2 * MAX_N];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
    sum[i] = (i == 0 ? a[i] : sum[i - 1] + (long long)a[i]);
  }
  long long i2 = n - k, v2 = (sum[n - 1] - (n - k == 0 ? 0 : sum[n - k - 1]));
  long long i1 = n - k - k,
            v1 = (sum[n - k - 1] - (n - k - k == 0 ? 0 : sum[n - k - k - 1]));
  long long ans1 = i1, ans2 = i2, ans = v1 + v2;
  while ((--i1) >= 0) {
    v1 = (sum[i1 + k - 1] - (i1 == 0 ? 0 : sum[i1 - 1]));
    if (v2 <= (sum[i1 + k + k - 1] - (i1 + k == 0 ? 0 : sum[i1 + k - 1])))
      i2 = i1 + k,
      v2 = (sum[i1 + k + k - 1] - (i1 + k == 0 ? 0 : sum[i1 + k - 1]));
    if (ans <= v1 + v2) ans1 = i1, ans2 = i2, ans = v1 + v2;
  }
  cout << ans1 + 1 << " " << ans2 + 1 << endl;
  return 0;
}
