#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
long long a[N] = {0};
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  if (2 * k == n) return printf("%d %d ", 1, k + 1), 0;
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    a[i] = x;
  }
  for (int i = 1; i <= n; i++) a[i] += a[i - 1];
  vector<long long> v(n - k + 2);
  vector<long long> vv(n - k + 2);
  for (int i = 1; i <= n - k + 1; i++) {
    long long t = a[i + k - 1] - a[i - 1];
    v[i] = t;
    vv[i] = t;
  }
  long long m = vv[vv.size() - 1];
  for (int i = vv.size() - 1; i > 0; i--) {
    m = max(m, vv[i]);
    vv[i] = m;
  }
  long long ans = -1, d = 0, maxb, b;
  for (int i = 1; i < v.size() - k; i++) {
    long long t = v[i] + vv[i + k];
    if (t > ans) {
      d = i;
      ans = t;
      maxb = vv[i + k];
    }
  }
  for (int i = 1; i < v.size(); i++) {
    if (i >= d && i <= d + k - 1) continue;
    if (i + k - 1 >= d && i + k - 1 <= d + k - 1) continue;
    if (v[i] == maxb) {
      b = i;
      break;
    }
  }
  cout << d << " " << b << endl;
  return 0;
}
