#include <bits/stdc++.h>
#pragma comment(linker, "/stack:247474112")
#pragma GCC optimize("Ofast")
using namespace std;
const long long maxn = 2e5 + 10;
long long a[maxn];
long long suf[maxn], mx[maxn];
int32_t main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long n, k;
  cin >> n >> k;
  for (long long i = 1; i <= n; ++i) cin >> a[i];
  for (long long i = n, temp = 0; i; i--) {
    temp += a[i];
    if (i + k <= n) temp -= a[i + k];
    suf[i] = suf[i + 1] + a[i];
    mx[i] = max(mx[i + 1], temp);
  }
  long long ans = 0, first, second, half;
  for (long long i = 1, temp = 0; i <= n; ++i) {
    temp += a[i];
    if (i - k > 0) temp -= a[i - k];
    if (temp + mx[i + 1] > ans) {
      ans = temp + mx[i + 1], first = i - k + 1;
      half = temp;
    }
  }
  for (long long i = first + k; i <= n; ++i) {
    if ((suf[i] - suf[i + k]) + half == ans) {
      second = i;
      break;
    }
  }
  cout << first << ' ' << second;
  return 0;
}
