#include <bits/stdc++.h>
using namespace std;
long long s = 0, val[200001];
int v[200001];
long long mx[200001];
int main() {
  int n, k;
  cin >> n >> k;
  long long res = -(1ll << 60);
  int a, b;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", v + i);
    s += v[i];
    if (i > k) s -= v[i - k];
    if (i >= k) {
      val[i] = s;
      mx[i] = i;
      if (val[i] <= val[mx[i - 1]]) {
        val[i] = val[mx[i - 1]];
        mx[i] = mx[i - 1];
      }
      if (i >= 2 * k) {
        if (res < val[mx[i - k]] + s) {
          res = val[mx[i - k]] + s;
          a = mx[i - k] - k + 1;
          b = i - k + 1;
        }
      }
    }
  }
  cout << a << " " << b;
  return 0;
}
