#include <bits/stdc++.h>
using namespace std;
int const maxN = 2e5 + 20;
long long n, k, a[maxN], mx = -1, ans1 = -1, ans2 = -1, x;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k;
  for (int i = (0); i < (n); i++) {
    cin >> x;
    a[max(0LL, i - k + 1)] += x;
    a[i + 1] -= x;
  }
  for (int i = (1); i < (n - k + 1); i++) {
    a[i] += a[i - 1];
  }
  for (int a1 = n - 2 * k, b1 = n - k; a1 >= 0; a1--) {
    if (a[a1 + k] >= a[b1]) b1 = a1 + k;
    if (a[a1] + a[b1] >= mx) {
      mx = a[a1] + a[b1];
      ans1 = a1 + 1;
      ans2 = b1 + 1;
    }
  }
  cerr << mx << endl;
  return cout << ans1 << ' ' << ans2, 0;
}
