#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pll = pair<ll, ll>;
using vll = vector<ll>;
using vpll = vector<pll>;
const ll MOD = 1e9 + 7, LIM = 1e6 + 5, INF = 1e18 + 5;
ll power(ll x, ll y, ll p) {
  ll r = 1;
  x %= p;
  while (y > 0) {
    if (y & 1) r = (r * x) % p;
    y >>= 1;
    x = (x * x) % p;
  }
  return r;
}
ll invmod(ll n, ll p) { return power(n, p - 2, p); }
bool comp(pll p1, pll p2) {
  if (p1.second == p2.second) return (p1.first < p2.first);
  return (p1.second < p2.second);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ll tt = 1;
  while (tt--) {
    ll n, k;
    cin >> n >> k;
    ll x[n + 1];
    for (ll i = 1; i <= n; i++) cin >> x[i];
    ll suf_sum[n - k + 2];
    for (ll i = 1; i <= n - k + 1; i++) {
      if (i == 1) {
        suf_sum[1] = 0;
        for (ll j = 1; j <= k; j++) {
          suf_sum[1] += x[j];
        }
        continue;
      }
      suf_sum[i] = suf_sum[i - 1] + x[i + k - 1] - x[i - 1];
    }
    ll max_suf_sum[n - k + 2];
    for (ll i = n - k + 1; i >= k + 1; i--) {
      if (i == n - k + 1) {
        max_suf_sum[i] = suf_sum[i];
        continue;
      }
      max_suf_sum[i] = max(suf_sum[i], max_suf_sum[i + 1]);
    }
    ll max_val = 0, a, b;
    for (ll i = 1; i <= n - 2 * k + 1; i++) {
      if (max_val < suf_sum[i] + max_suf_sum[i + k]) {
        max_val = suf_sum[i] + max_suf_sum[i + k];
        a = i;
      }
    }
    for (ll i = a + k; i <= n - k + 1; i++) {
      if (suf_sum[i] == max_val - suf_sum[a]) {
        b = i;
        break;
      }
    }
    cout << a << " " << b;
  }
}
