#include <bits/stdc++.h>
using namespace std;
long long int fast(long long int n, long long int a, long long int m) {
  if (n == 0)
    return 1;
  else if (n == 1)
    return a;
  else {
    long long int r = fast(n / 2, a, m);
    if (n % 2 == 0) {
      return (((r % m) * (r % m)) % m);
    } else {
      return (((((r % m) * a) % m) * r) % m);
    }
  }
}
int main() {
  long long int n, K;
  cin >> n >> K;
  long long int A[n];
  long long int i;
  for (i = 0; i < n; i++) {
    cin >> A[i];
  }
  long long int p[n + 1];
  p[0] = 0;
  for (i = 1; i <= n; i++) {
    p[i] = p[i - 1] + A[i - 1];
  }
  vector<long long int> pos, mps;
  long long int S = 0, r = n - K + 1;
  for (i = n - K + 1; i >= K + 1; i--) {
    long long int d = p[i + K - 1] - p[i - 1];
    if (d >= S) {
      S = d;
      r = i;
      pos.push_back(r);
      mps.push_back(S);
    } else {
      pos.push_back(r);
      mps.push_back(S);
    }
  }
  long long int j = pos.size() - 1, S2 = 0;
  long long int u, v;
  for (i = 1; i <= n - 2 * K + 1; i++) {
    long long int dt = p[i + K - 1] - p[i - 1];
    if (dt + mps[j] > S2) {
      S2 = dt + mps[j];
      u = i;
      v = pos[j];
    }
    j--;
  }
  cout << u << " " << v;
}
