#include <bits/stdc++.h>
using namespace std;
int dx[8] = {0, 0, 1, -1, 1, 1, -1, -1};
int dy[8] = {1, -1, 0, 0, 1, -1, 1, -1};
template <typename T>
inline T BigMod(T A, T B) {
  T ret = 1;
  while (B) {
    if (B & 1) ret = (ret * A) % 1000000007;
    A = (A * A) % 1000000007;
    B = B >> 1;
  }
  return ret;
}
template <typename T>
inline T InvMod(T A, T M = 1000000007) {
  return BigMod(A, M - 2);
}
string tostring(long long int res) {
  string curstr = "";
  while (res != 0) {
    long long int temp = (res % 10);
    curstr += ((char)temp + '0');
    res /= 10;
  }
  reverse(curstr.begin(), curstr.end());
  return curstr;
}
long long int toint(string ss) {
  long long int inss = 0;
  for (int i = 0; i < ss.size(); i++) {
    inss = (inss * 10) + ((int)(ss[i] - '0'));
  }
  return inss;
}
long long int ar[200005], cum[200005];
struct ST {
  long long int val;
  int ind;
};
ST rightt[2000005];
int main() {
  int n, k;
  scanf("%d", &n);
  scanf("%d", &k);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &ar[i]);
    cum[i] = cum[i - 1] + ar[i];
  }
  int in = 0;
  for (int i = 1; i <= n; i++) rightt[i].val = -2e18;
  for (int i = 1; i <= n; i++) {
    int st = i - 1;
    int en = i + k - 1;
    if (en > n) {
      break;
    }
    long long int now = cum[en] - cum[st];
    if (now > rightt[en - 1].val) {
      rightt[en].val = now;
      rightt[en].ind = i;
    } else
      rightt[en] = rightt[en - 1];
  }
  int ans1, ans2;
  long long int res = -2e15;
  for (int i = n;; i--) {
    int st = i - k;
    int en = i;
    if (st < 0) break;
    if (st - k + 1 <= 0) break;
    long long int now = cum[en] - cum[st];
    long long int rt = rightt[st].val;
    now += rt;
    if (res <= now) {
      res = now;
      ans1 = rightt[st].ind;
      ans2 = st + 1;
    }
  }
  cout << ans1 << " " << ans2 << endl;
  return 0;
}
