#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> V(n);
  for (int i = 0; i < n; i++) {
    cin >> V[i];
  }
  vector<long long> v;
  long long temp = 0;
  for (int i = 0; i < m; i++) {
    temp += V[i];
  }
  for (int i = 0; i < n - m + 1; i++) {
    if (i == 0) {
      v.push_back(temp);
      continue;
    } else {
      temp = temp + V[i + m - 1] - V[i - 1];
      v.push_back(temp);
    }
  }
  long long Max = -1;
  n = v.size();
  long long i_x = n - 1;
  vector<pair<long long, long long> > b(n);
  for (int i = n - 1; i >= 0; i--) {
    if (Max <= v[i]) {
      Max = v[i];
      i_x = i;
      b[i] = {Max, i_x};
    } else {
      b[i] = {Max, i_x};
    }
  }
  long long max_x = 0;
  long long mini = 0, minj;
  for (int i = 0; i < n - m; i++) {
    if (max_x < v[i] + b[i + m].first) {
      max_x = v[i] + b[i + m].first;
      mini = i;
      minj = b[i + m].second;
    }
  }
  cout << mini + 1 << " " << minj + 1;
  return 0;
}
