#include <bits/stdc++.h>
using namespace std;
bool mycomp(pair<int, long long>, pair<int, long long>);
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  vector<int> num(n);
  vector<long long> sum(n);
  vector<int> qu(n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &num[i]);
  }
  sum[0] = 0;
  for (int i = 0; i < k; i++) sum[0] += num[i];
  for (int i = 1; i < n; i++) {
    sum[i] = sum[i - 1] - num[i - 1];
    if ((i + k - 1) < n) sum[i] += num[i + k - 1];
  }
  qu[n - 1] = n - 1;
  for (int i = n - 2; i >= 0; i--) {
    if (sum[i] < sum[qu[i + 1]])
      qu[i] = qu[i + 1];
    else
      qu[i] = i;
  }
  int a, b, c;
  long long res, t1;
  a = b = res = 0;
  for (int i = 0; i <= (n - 2 * k); i++) {
    if ((sum[qu[i + k]] + sum[i]) > res) {
      res = sum[qu[i + k]] + sum[i];
      a = i;
      b = qu[i + k];
    }
  }
  printf("%d %d\n", a + 1, b + 1);
  return 0;
}
