#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  long long *x = new long long[n + 1];
  for (int i = 1; i <= n; i++) cin >> x[i];
  long long *s = new long long[n + 1];
  s[0] = 0;
  for (int i = 1; i <= n; i++) s[i] = s[i - 1] + x[i];
  long long *a = new long long[n + 1];
  long long *resL = new long long[n + 1];
  long long *resR = new long long[n + 1];
  long long *b = new long long[n + 1];
  resL[0] = -1000000;
  for (int i = 1; i <= n; i++) {
    if (i - k >= 0) {
      if (s[i] - s[i - k] > resL[i - 1]) {
        resL[i] = s[i] - s[i - k];
        a[i] = i - k + 1;
      } else {
        resL[i] = resL[i - 1];
        a[i] = a[i - 1];
      }
    } else
      resL[i] = -1000000;
  }
  resR[n] = -1000000;
  for (int i = n - 1; i >= 0; i--) {
    if (i + k <= n) {
      if (s[i + k] - s[i] >= resR[i + 1]) {
        resR[i] = s[i + k] - s[i];
        b[i] = i + 1;
      } else {
        resR[i] = resR[i + 1];
        b[i] = b[i + 1];
      }
    } else
      resR[i] = -1000000;
  }
  int bestA, bestB;
  long long bestRes = -1000000;
  for (int i = 1; i <= n; i++) {
    if (resL[i] + resR[i] > bestRes) {
      bestRes = resL[i] + resR[i];
      bestA = a[i];
      bestB = b[i];
    } else if (resL[i] + resR[i] == bestRes) {
      if (a[i] < bestA) {
        bestA = a[i];
        bestB = b[i];
      } else if (a[i] == bestA) {
        if (b[i] < bestB) bestB = b[i];
      }
    }
  }
  cout << bestA << ' ' << bestB;
  delete[] x, s, a, b, resL, resR;
  return 0;
}
