#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5, MOD = 1e9 + 7;
long long n, k, x, cs[N], a, b;
vector<pair<long long, long long> > v;
int main() {
  scanf("%lld%lld", &n, &k);
  for (int i = 1; i <= n; ++i) {
    scanf("%lld", &x);
    cs[i] = cs[i - 1] + x;
  }
  long long mx1, mx2;
  mx1 = mx2 = 0;
  for (int i = 1; i <= n - k + 1; ++i) {
    mx2 = cs[i + k - 1] - cs[i - 1];
    v.push_back({mx2, -i});
  }
  sort(v.begin(), v.end());
  vector<int> z;
  for (int i = v.size() - 1; i > -1; i--) {
    int idx = -v[i].second;
    if (!a && (idx > k || n - (idx + k - 1) >= k)) {
      a = idx;
      continue;
    } else if (a && (idx <= a - k || idx >= a + k)) {
      b = idx;
      break;
    }
    z.push_back(idx);
  }
  sort(z.begin(), z.end());
  mx1 = (cs[a + k - 1] - cs[a - 1]) + (cs[b + k - 1] - cs[b - 1]);
  for (int i = 0; i < z.size(); ++i) {
    int d = lower_bound(z.begin() + i, z.end(), z[i] + k) - z.begin();
    mx2 = 0;
    int idx;
    if (d && d < z.size()) {
      for (int j = d; j < z.size(); ++j) {
        if (mx2 < (cs[z[i] + k - 1] - cs[z[i] - 1]) +
                      (cs[z[j] + k - 1] - cs[z[j] - 1])) {
          mx2 = (cs[z[i] + k - 1] - cs[z[i] - 1]) +
                (cs[z[j] + k - 1] - cs[z[j] - 1]);
          idx = j;
        }
      }
    }
    if (mx1 < mx2) {
      a = z[i];
      b = z[idx];
      mx1 = mx2;
    }
  }
  printf("%lld %lld", min(a, b), max(a, b));
  return 0;
}
