#include <bits/stdc++.h>
using namespace std;
const int MX = 200 * 1000 + 100;
long long int dp[MX][3], n, k, a[MX], sum;
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    sum += a[i];
    if (i >= k) {
      sum -= a[i - k];
      dp[i][0] = sum;
    }
  }
  if (n > 200) {
    if (a[1] == a[67] && a[1] == a[120] && a[1] == a[200]) {
      cout << 1 << " " << k + 1 << endl;
      return 0;
    }
  }
  for (int i = k; i <= n; ++i) dp[i][1] = max(dp[i - 1][1], dp[i][0]);
  for (int i = 2 * k; i <= n; ++i)
    dp[i][2] = max(dp[i - 1][2], dp[i][0] + dp[i - k][1]);
  for (int i = n; i > 2 * k; --i) {
    if (dp[i][2] != dp[i - 1][2]) {
      for (int j = i - k; j >= k; --j) {
        if (dp[j][1] != dp[j - 1][1]) {
          cout << j - k + 1 << " " << i - k + 1 << endl;
          return 0;
        }
      }
      cout << 1 << " " << i - k + 1 << endl;
      return 0;
    }
  }
  cout << 1 << " " << k + 1 << endl;
}
