#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cout << *it << " = " << a << endl;
  err(++it, args...);
}
const int N = 2 * (1e5 + 9);
long long int lleft[N], rright[N];
pair<long long int, long long int> ml[N], mr[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  vector<long long int> v(n + 2);
  v[0] = 0, v[(v).size() - 1] = 0;
  for (long long int i = (long long int)(1); i < (long long int)(n + 1); i++)
    cin >> v[i];
  for (int i = 1, j = n; i <= n; i++, j--)
    lleft[i] = lleft[i - 1] + v[i], rright[j] = rright[j + 1] + v[j];
  long long int maxil = 0, maxir = 0;
  for (int i = 0, j = k, j_ot = n - k + 1, i_ot = n + 1; j <= n;
       i++, j++, j_ot--, i_ot--) {
    long long int sum = lleft[j] - lleft[i],
                  sum_ot = rright[j_ot] - rright[i_ot];
    if (sum > maxil)
      maxil = sum, ml[j] = {i + 1, sum};
    else
      ml[j] = ml[j - 1];
    if (sum_ot >= maxir)
      maxir = sum_ot, mr[j_ot] = {j_ot, sum_ot};
    else
      mr[j_ot] = mr[j_ot + 1];
  }
  long long int foo = 0;
  for (int i = k, ind = 0; i <= n; i++)
    foo = max(foo, ml[i].second + mr[i + 1].second);
  vector<pair<long long int, long long int> > ans;
  for (int i = k, ind = 0; i <= n; i++)
    if ((ml[i].second + mr[i + 1].second) == foo)
      ans.push_back({ml[i].first, mr[i + 1].first});
  sort((ans).begin(), (ans).end());
  cout << ans[0].first << " " << ans[0].second << endl;
  return 0;
}
