#include <bits/stdc++.h>
using namespace std;
const int MAXN = 210000;
int src[MAXN];
long long a[MAXN * 4], s2[MAXN];
int n, k, N;
void make_tree(int v, int tl, int tr) {
  if (tl == tr)
    a[v] = s2[tl];
  else {
    int t = (tl + tr) / 2;
    make_tree(v * 2, tl, t);
    make_tree(v * 2 + 1, t + 1, tr);
    a[v] = max(a[v * 2], a[v * 2 + 1]);
  }
}
long long get_max_(int v, int tl, int tr, int l, int r) {
  if (l > r) return -100000000000000000;
  if (l == tl && r == tr) return a[v];
  int tm = (tl + tr) / 2;
  return max(get_max_(v * 2, tl, tm, l, min(r, tm)),
             get_max_(v * 2 + 1, tm + 1, tr, max(l, tm + 1), r));
}
long long get_max(int l, int r) { return get_max_(1, 0, N - 1, l, r); }
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) scanf("%d", &(src[i]));
  long long curr_sum = 0;
  for (int i = 0; i < k; i++) curr_sum += src[i];
  N = n - k + 1;
  for (int i = 0; i < N; i++) {
    s2[i] = curr_sum;
    curr_sum = curr_sum - src[i] + src[i + k];
  }
  make_tree(1, 0, N - 1);
  int la_;
  long long max_sum = -100000000000000000;
  for (int la = 0; la < N - k; la++) {
    long long t1 = s2[la], t2 = get_max(la + k, N - 1);
    if (t1 + t2 > max_sum) {
      max_sum = t1 + t2;
      la_ = la;
    }
  }
  long long sum_b = -1, lb_;
  for (int lb = la_ + k; lb < N; lb++)
    if (s2[lb] > sum_b) {
      sum_b = s2[lb];
      lb_ = lb;
    }
  cout << ++la_ << " " << ++lb_ << endl;
  return 0;
}
