#include <bits/stdc++.h>
using namespace std;
long long x[2 * 100005], c[2 * 100005];
pair<long long, long long> p[2 * 100005];
int main() {
  long long n, k;
  cin >> n >> k;
  for (long long i = 0; i < n; i++) cin >> x[i];
  long long sum = 0;
  for (long long i = 0; i < k; i++) sum += x[i];
  c[0] = sum;
  for (long long i = 1; i < n - k + 1; i++)
    c[i] = c[i - 1] - x[i - 1] + x[i + k - 1];
  long long a, b;
  sum = 0;
  long long pos = 0;
  for (long long i = 0; i < n - k + 1; i++) {
    if (sum < c[i]) {
      sum = c[i];
      pos = i;
    }
    p[i] = make_pair(sum, pos);
  }
  sum = 0;
  a = -1;
  b = -1;
  for (long long j = k; j < n - k + 1; j++) {
    if (p[j - k].first + c[j] > sum) {
      sum = p[j - k].first + c[j];
      a = p[j - k].second;
      b = j;
    }
  }
  cout << a + 1 << " " << b + 1 << endl;
  return 0;
}
