#include <bits/stdc++.h>
using namespace std;
const int size = 1004;
const long long modulo = 1000000007;
int k = 0;
void banzai(vector<int>& a, int l, int r) {
  if (l == r) {
    int left = 0, right = 0;
    for (int i = 1; i <= r; i++)
      for (int j = 0; j < i; j++)
        if (a[j] > a[i]) ++left;
    for (int i = r - 1; i >= 0; i--)
      for (int j = i + 1; j <= r; j++)
        if (a[j] > a[i]) ++right;
    if (left == right) {
      ++k;
    }
  } else {
    for (int i = l; i <= r; i++) {
      swap(a[l], a[i]);
      banzai(a, l + 1, r);
      swap(a[l], a[i]);
    }
  }
}
int main() {
  int n, k;
  cin >> n >> k;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  vector<long long> b(1, 0);
  for (int i = 0; i < k; i++) b[0] += a[i];
  for (int i = k; i < n; i++) b.push_back(b[i - k] + a[i] - a[i - k]);
  vector<long long> c(b.size());
  c.back() = b.back();
  for (int i = c.size() - 2; i >= 0; i--) c[i] = max(c[i + 1], b[i]);
  long long aa = 0, r = 0;
  for (int i = 0; i < b.size() - k; i++)
    if (b[i] + c[i + k] > r) {
      aa = i;
      r = b[i] + c[i + k];
    }
  long long d = 0;
  for (int i = aa + k; i < b.size(); i++)
    if (b[i] == r - b[aa]) {
      d = i + 1;
      break;
    }
  aa++;
  cout << aa << ' ' << d << endl;
  return 0;
}
