#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
long long ret[10][200005];
long long dp(long long x, long long m) {
  long long &u = ret[x][m];
  if (m == 0) return 1;
  if (u != -1) {
    return u;
  }
  if (x == 9) {
    u = dp(0, m - 1) + dp(1, m - 1);
    u %= MOD;
  } else
    u = dp(x + 1, m - 1);
  u %= MOD;
  return u;
}
int bb[400005];
int best[400005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long a, b;
  cin >> a >> b;
  vector<long long> v;
  vector<pair<long long, long long>> p;
  vector<long long> pref;
  for (long long i = 1; i <= a; i++) {
    cin >> bb[i];
  }
  pref.push_back(0);
  for (long long i = 1; i <= a; i++) {
    pref.push_back(bb[i] + pref[i - 1]);
  }
  vector<pair<long long, long long>> best(a + 5);
  for (int i = a - b + 1; i >= 1; i--) {
    long long segment = pref[i + b - 1] - pref[i - 1];
    if (best[i + 1].first <= segment) {
      best[i] = {segment, i};
    } else {
      best[i] = best[i + 1];
    }
  }
  pair<int, int> answer;
  long long total = 0;
  for (int i = a - b * 2 + 1; i >= 1; i--) {
    long long segment = pref[i + b - 1] - pref[i - 1];
    long long u = best[i + b].first + segment;
    if (u >= total) {
      long long aa = i;
      long long bd = best[i + b].second;
      answer = {aa, bd};
      total = u;
    }
  }
  cout << answer.first << " " << answer.second << "\n";
  return 0;
}
