#include <bits/stdc++.h>
using namespace std;
void FASTIO() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
long long n, k;
string s;
void solve() {
  cin >> n >> k;
  long long sum1 = 0;
  long long sum2 = 0;
  vector<long long> v(n);
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
    if (i < k) {
      sum1 += v[i];
    } else if (i >= k && i < 2 * k) {
      sum2 += v[i];
    }
  }
  long long first = sum1;
  long long sec = sum2;
  long long maxi = sum1 + sum2;
  long long i = k;
  long long j = 2 * k;
  long long fi = 0;
  long long fj = k;
  long long a = 1;
  long long temp = 1;
  long long b = k + 1;
  while (j < n) {
    first -= v[fi];
    first += v[i];
    sec -= v[fj];
    sec += v[j];
    fi++;
    fj++;
    if (first > sum1) {
      sum1 = first;
      temp = fi + 1;
    }
    if (sum1 + sec > maxi) {
      maxi = sum1 + sec;
      a = temp;
      b = fj + 1;
    }
    i++;
    j++;
  }
  cout << a << " " << b << "\n";
}
int32_t main() {
  FASTIO();
  { solve(); }
  return 0;
}
