#include <bits/stdc++.h>
using namespace std;
int n, k;
long long v[200005];
pair<long long, int> bit[200005];
pair<long long, int> f(pair<long long, int> a, pair<long long, int> b) {
  if (a.first != b.first) return max(a, b);
  return min(a, b);
}
pair<long long, int> query(int x) {
  pair<long long, int> ans = make_pair(-(1000000000000000000L), -1);
  for (; x > 0; x -= x & -x) ans = f(ans, bit[x]);
  return ans;
}
void add(int x, long long value) {
  pair<long long, int> v = make_pair(value, x);
  for (; x <= n; x += x & -x) bit[x] = f(bit[x], v);
}
pair<pair<long long, int>, int> g(pair<pair<long long, int>, int> a,
                                  pair<pair<long long, int>, int> b) {
  if (a.first.first != b.first.first) return max(a, b);
  return min(a, b);
}
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%lld", v + i);
  long long tmp = 0;
  for (int i = 1; i < k; i++) tmp += v[i];
  vector<long long> s;
  s.push_back(0);
  for (int i = 1; i <= n - k + 1; i++) {
    tmp += v[i + k - 1];
    add(i, tmp);
    s.push_back(tmp);
    tmp -= v[i];
  }
  pair<pair<long long, int>, int> ans =
      make_pair(make_pair(-(1000000000000000000L), -1), -1);
  for (int i = n - k + 1; i > k; i--) {
    pair<long long, int> q = query(i - k);
    ans = g(ans, make_pair(make_pair(q.first + s[i], q.second), i));
  }
  printf("%d %d\n", ans.first.second, ans.second);
  return 0;
}
