#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
void umax(int &a, int b) { a = max(a, b); }
void umin(int &a, int b) { a = min(a, b); }
void file() { freopen("a.in", "r", stdin); }
namespace Solver {
const int maxn = 220000;
int n, k;
long long v[maxn];
long long dp[maxn], suf[maxn], id[maxn];
void solve() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &v[i]);
  long long sum = 0;
  for (int i = n; i > n - k; i--) sum += v[i];
  dp[n - k + 1] = sum;
  for (int i = n - k; i >= 1; i--) {
    sum += v[i];
    sum -= v[i + k];
    dp[i] = sum;
  }
  for (int i = n; i >= 1; i--) {
    if (dp[i] >= suf[i + 1])
      suf[i] = dp[i], id[i] = i;
    else
      suf[i] = suf[i + 1], id[i] = id[i + 1];
  }
  long long ans = 0;
  int ans1, ans2;
  for (int i = 1; i <= n - 2 * k + 1; i++) {
    if (ans < dp[i] + suf[i + k]) {
      ans = dp[i] + suf[i + k];
      ans1 = i;
      ans2 = id[i + k];
    }
  }
  cout << ans1 << " " << ans2 << endl;
}
};  // namespace Solver
int main() {
  Solver::solve();
  return 0;
}
