#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  int n, k;
  cin >> n >> k;
  vector<long long int> A(n + 2, 0), dp1(n + 2, 0), dp2(n + 2, 0),
      sum(n + 2, 0), idx(n + 2, 0);
  for (int i = 1; i <= n; i++) {
    cin >> A[i];
  }
  for (int i = 1; i <= n; i++) {
    sum[i] = sum[i - 1] + A[i];
  }
  for (int i = 1; i <= n - k + 1; i++) {
    dp1[i] = sum[i + k - 1] - sum[i - 1];
    dp2[i] = dp1[i];
  }
  long long int fans = 0;
  for (int i = n; i >= 1; i--) {
    if (dp2[i] < dp2[i + 1]) {
      dp2[i] = dp2[i + 1];
      idx[i] = idx[i + 1];
    } else {
      idx[i] = i;
    }
  }
  int aa, bb;
  for (int i = 1; i < n - k + 1; i++) {
    if (fans < dp1[i] + dp2[i + k]) {
      fans = dp1[i] + dp2[i + k];
      aa = i;
      bb = idx[i + k];
    }
  }
  cout << aa << " " << bb;
  return 0;
}
