#include <bits/stdc++.h>
using namespace std;
const long long INF = (long long)1e18;
ifstream Cin("input.txt");
ofstream Cout("output.txt");
int main() {
  long long n, k, i, j;
  cin >> n >> k;
  vector<long long> r(n + 1), s(n + 1), s1(n + 1), s2(n + 1), p1(n + 1),
      p2(n + 1);
  for (i = 1; i <= n; ++i) cin >> r[i], s[i] = s[i - 1] + r[i];
  for (i = k; i <= n; i++) {
    s1[i] = s1[i - 1];
    p1[i] = p1[i - 1];
    if (s[i] - s[i - k] > s1[i]) {
      s1[i] = s[i] - s[i - k];
      p1[i] = i - k + 1;
    }
  }
  for (i = 2 * k; i <= n; i++) {
    s2[i] = s2[i - 1];
    p2[i] = p2[i - 1];
    if (s[i] - s[i - k] + s1[i - k] > s2[i]) {
      s2[i] = s[i] - s[i - k] + s1[i - k];
      p2[i] = i - k + 1;
    }
  }
  cout << p1[p2[n] - 1] << " " << p2[n];
}
