#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int N = 2e5 + 10;
long long sum[N];
long long a[N], b[N];
long long f[N][20];
int n, k, top;
long long MAX(long long x, long long y) {
  if (x < y) return y;
  return x;
}
void advan() {
  for (int i = 1; i <= top; ++i) f[i][0] = b[i];
  for (int i = 1; (1 << i) <= top; ++i) {
    for (int j = 1; j + (1 << i) - 1 <= top; ++j)
      f[j][i] = f[j][i - 1] < f[j + (1 << (i - 1))][i - 1]
                    ? f[j + (1 << (i - 1))][i - 1]
                    : f[j][i - 1];
  }
}
long long query(int l, int r) {
  int k = 0;
  k = log2(double(r - l + 1));
  return MAX(f[l][k], f[r - (1 << k) + 1][k]);
}
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; ++i) {
    scanf("%lld", &a[i]);
    sum[i] = sum[i - 1] + a[i];
  }
  top = 0;
  for (int i = k; i <= n; ++i) b[++top] = sum[i] - sum[i - k];
  advan();
  long long maxx = 0, L = 0, R = 0, be, res = 0, en;
  for (int i = 1; i <= top - k; ++i) {
    L = b[i];
    R = query(i + k, top);
    if (L + R > maxx) {
      maxx = L + R;
      res = R;
      be = i;
    }
  }
  for (int i = be + k; i <= top; ++i) {
    if (b[i] == res) {
      en = i;
      break;
    }
  }
  printf("%lld %lld\n", be, en);
  return 0;
}
