#include <bits/stdc++.h>
using namespace std;
const int s = 2e5 + 9;
long long max(long long a, long long b) {
  if (a > b) return a;
  return b;
}
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  vector<long long> v;
  long long x[n], ans[n], a = 0, b = 0, sum = 0, maxi = 0;
  vector<pair<long long, int> > dp(n);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &x[i]);
    if (i >= k) {
      maxi = max(maxi, sum);
      dp[i - k].first = maxi;
      if (i > k) {
        if (dp[i - k].first > dp[i - k - 1].first)
          dp[i - k].second = i - k + 1;
        else
          dp[i - k].second = dp[i - k - 1].second;
      }
      if (i == k) dp[i - k].second = 1;
      ans[i - k] = sum;
      sum -= x[i - k];
    }
    sum += x[i];
  }
  maxi = 0;
  long long maxa = 0, maxb = 0;
  ans[n - k] = sum;
  for (int i = k; i <= n - k; i++) {
    if (dp[i - k].first + ans[i] > maxi) {
      maxi = dp[i - k].first + ans[i];
      a = dp[i - k].second;
      b = i + 1;
    }
  }
  cout << a << " " << b;
}
