#include <bits/stdc++.h>
using namespace std;
const int N = 4000002;
int n, k, x[N], save[N];
long long sum[N], dp[N];
long long query(int a, int b) {
  if (b > n) b = n;
  return sum[b] - sum[a - 1];
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) {
    cin >> x[i];
    sum[i] = sum[i - 1] + x[i];
  }
  for (int i = n - k + 1; i > 0; --i) {
    save[i] = i;
    dp[i] = query(i, i + k - 1);
  }
  for (int i = n - k; i > 0; --i) {
    if (dp[i + 1] > dp[i]) {
      dp[i] = dp[i + 1];
      save[i] = save[i + 1];
    }
  }
  long long mx = 0;
  int mxi = 0, next = 0;
  for (int i = 1; i <= n - k * 2 + 1; ++i) {
    long long Q = query(i, i + k - 1) + dp[i + k];
    if (Q > mx) {
      mx = Q;
      mxi = i;
      next = save[i + k];
    }
  }
  cout << mxi << ' ' << next << endl;
}
