#include <bits/stdc++.h>
const int MOD = 1000000007;
using namespace std;
const int MAX_N = 200005;
long long psum[MAX_N];
long long dp[MAX_N][2];
long long dp2[MAX_N][2];
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  int a[n + 1];
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    psum[i] = psum[i - 1] + a[i];
  }
  for (int i = k; i <= n; i++) {
    if (psum[i] - psum[i - k] > dp[i - 1][0]) {
      dp[i][0] = psum[i] - psum[i - k];
      dp[i][1] = i - k + 1;
    } else {
      dp[i][0] = dp[i - 1][0];
      dp[i][1] = dp[i - 1][1];
    }
  }
  pair<int, int> ans;
  for (int sE = 2 * k; sE <= n; sE++) {
    if (psum[sE] - psum[sE - k] + dp[sE - k][0] > dp2[sE - 1][0]) {
      dp2[sE][0] = psum[sE] - psum[sE - k] + dp[sE - k][0];
      dp2[sE][1] = sE - k + 1;
      ans = {dp[sE - k][1], sE - k + 1};
    } else {
      dp2[sE][0] = dp2[sE - 1][0];
      dp2[sE][1] = dp2[sE - 1][1];
    }
  }
  cout << ans.first << " " << ans.second << "\n";
}
