#include <bits/stdc++.h>
using namespace std;
long long fastpow(long long a, long long b) {
  if (!b) return 1ll;
  if (b % 2 == 1) return fastpow(a, b - 1) * a;
  long long t = fastpow(a, b / 2);
  return t * t;
}
struct op {
  long long l, r, d;
};
void solve() {
  long long n, k, sum = 0, id1, id2, id3;
  cin >> n >> k;
  vector<long long> a(n), pref(n + 1);
  for (long long i = 0; i < n; ++i) {
    cin >> a[i];
    pref[i + 1] = pref[i] + a[i];
  }
  long long maxb = pref[n] - pref[n - k];
  id3 = n - k;
  for (long long i = n - 2 * k; i >= 0; i--) {
    long long a = pref[i + k] - pref[i];
    long long b = pref[i + 2 * k] - pref[i + k];
    if (b >= maxb) {
      maxb = b;
      id3 = i + k;
    }
    if (a + maxb >= sum) {
      id1 = i;
      id2 = id3;
      sum = a + maxb;
    }
  }
  cout << id1 + 1 << " " << id2 + 1 << "\n";
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(15);
  long long t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
