#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 23;
const int MAXN = 2e5 + 100;
int arr[MAXN];
pair<long long, int> mxsuf[MAXN];
int main() {
  ios_base::sync_with_stdio(0);
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) {
    cin >> arr[i];
  }
  long long cur = 0;
  for (int i = n, j = 0; j < k; --i, ++j) {
    cur += arr[i];
  }
  mxsuf[n - k + 1] = {cur, n - k + 1};
  for (int i = n - k; i >= 0; --i) {
    cur -= arr[i + k];
    cur += arr[i];
    if (cur >= mxsuf[i + 1].first) {
      mxsuf[i] = {cur, i};
    } else {
      mxsuf[i] = mxsuf[i + 1];
    }
  }
  cur = 0;
  for (int i = 1; i < k; ++i) {
    cur += arr[i];
  }
  long long ans = 0;
  pair<int, int> ansind = {0, 0};
  for (int i = k; i <= n; ++i) {
    cur += arr[i];
    cur -= arr[i - k];
    if (cur + mxsuf[i + 1].first > ans) {
      ans = cur + mxsuf[i + 1].first;
      ansind = {i - k + 1, mxsuf[i + 1].second};
    }
  }
  cout << ansind.first << " " << ansind.second << "\n";
  return 0;
}
