#include <bits/stdc++.h>
using namespace std;
long long n, k, d;
long long a[200005] = {0};
long long precal[200005] = {0};
long long sum(int r, int l) {
  if (l == 0)
    return precal[r];
  else
    return precal[r] - precal[l - 1];
}
void get_values() {
  std::cin >> n >> k;
  for (int i = 0; i < n; i++) std::cin >> a[i];
  precal[0] = a[0];
  for (int i = 1; i < n; i++) precal[i] = precal[i - 1] + a[i];
  if (n == 2 * k) std::cout << 1 << " " << 1 + k << std::endl;
  return;
}
void solve() {
  long long i, a, x, b, answer = 0;
  pair<long long, long long> prev;
  a = n - 2 * k;
  b = n - k;
  answer = sum(n - k - 1, n - 2 * k) + sum(n - 1, n - k);
  prev = {n - k, sum(n - 1, n - k)};
  for (i = n - 2 * k - 1; i >= 0; i--) {
    x = sum(i + 2 * k - 1, i + k);
    if (x >= prev.second) prev = {i + k, x};
    x = sum(i + k - 1, i) + prev.second;
    if (x >= answer) answer = x, a = i, b = prev.first;
  }
  std::cout << min(a, b) + 1 << " " << max(a, b) + 1 << std::endl;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  ;
  get_values();
  if (k * 2 != n) solve();
  return 0;
}
