#include <bits/stdc++.h>
using namespace std;
const int INF = 0x7fffffff;
const int MAXN = 200000 + 10;
int num[MAXN];
long long sum[MAXN], sumK[MAXN];
int k, n;
typedef struct Node {
  int start, end;
  long long sumKK;
} Node;
Node tree[4 * MAXN];
long long max(long long x, long long y) { return x > y ? x : y; }
void build(int now, int s, int e) {
  tree[now].start = s;
  tree[now].end = e;
  int mid = (e - s) >> 1;
  if (e == s)
    tree[now].sumKK = sumK[s];
  else {
    build(now * 2 + 1, s, (s + e) >> 1);
    build(now * 2 + 2, ((s + e) >> 1) + 1, e);
    tree[now].sumKK = max(tree[now * 2 + 1].sumKK, tree[now * 2 + 2].sumKK);
  }
}
long long query(int now, int s, int e) {
  int start = tree[now].start, end = tree[now].end;
  int mid = (start + end) >> 1;
  if (start == s && end == e) return tree[now].sumKK;
  if (e <= mid)
    return query(now * 2 + 1, s, e);
  else if (s > mid)
    return query(now * 2 + 2, s, e);
  else
    return max(query(now * 2 + 1, s, mid), query(now * 2 + 2, mid + 1, e));
}
int main() {
  n = 0;
  k = 0;
  scanf("%d%d", &n, &k);
  sum[0] = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &num[i]);
    sum[i] += (sum[i - 1] + num[i]);
  }
  for (int i = 1; i <= n - k + 1; i++) sumK[i] = sum[i + k - 1] - sum[i - 1];
  build(0, 1, n - k + 1);
  long long ans = 0;
  long long ansTmp = 0;
  int index = 0;
  for (int i = 1; i <= n - k + 1 - k; i++) {
    long long x = sumK[i];
    long long tmp = 0;
    tmp = x + query(0, i + k, n - k + 1);
    if (tmp > ans) {
      ans = tmp;
      index = i;
      ansTmp = x;
    }
  }
  int index2 = 0;
  for (int i = index + k; i <= n - k + 1; i++) {
    if (sum[i + k - 1] - sum[i - 1] == ans - ansTmp) {
      index2 = i;
      break;
    }
  }
  printf("%d %d\n", index, index2);
  return 0;
}
