#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, cou, x, y;
  long long t;
  cin >> n >> k;
  int a[n + 1];
  long long sum1[n + 1];
  long long max1[n + 1];
  long long max2[n + 1];
  long long sum2[n + 1];
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    sum1[i] = 0;
    max1[i] = 0;
    max2[i] = 0;
    sum2[i] = 0;
  }
  int num1[n + 1];
  int num2[n + 1];
  for (int i = 1; i <= k; i++) sum1[k] += a[i];
  max1[k] = sum1[k];
  t = max1[k];
  num1[k] = 1;
  cou = 1;
  for (int i = k + 1; i <= n; i++) {
    sum1[i] = sum1[i - 1] + a[i] - a[i - k];
    if (t >= sum1[i]) {
      max1[i] = t;
      num1[i] = cou;
    } else {
      cou = i - k + 1;
      num1[i] = cou;
      t = sum1[i];
      max1[i] = t;
    }
  }
  t = 0;
  for (int i = n; i >= n - k + 1; i--) {
    t += a[i];
  }
  max2[n - k + 1] = t;
  sum2[n - k + 1] = t;
  num2[n - k + 1] = n - k + 1;
  cou = n - k + 1;
  for (int i = n - k; i >= 0; i--) {
    sum2[i] = sum2[i + 1] + a[i] - a[i + k];
    if (t > sum2[i]) {
      max2[i] = t;
      num2[i] = cou;
    } else {
      t = sum2[i];
      max2[i] = t;
      cou = i;
      num2[i] = cou;
    }
  }
  t = 0;
  int l = n - k;
  for (int i = k; i <= l; i++) {
    if (t < max1[i] + max2[i + 1]) {
      x = num1[i];
      y = num2[i + 1];
      t = max1[i] + max2[i + 1];
    }
  }
  cout << x << " " << y << endl;
}
