#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double EPS = (1e-10);
const long long mod = (1e9) + 7;
int n, k;
long long int sum[200005];
vector<long long int> num(200005);
long long int dp[200005][3];
long long int rem[200005][3];
long long int solve(int index, int left) {
  if (index > n || left <= 0) return 0;
  if (dp[index][left] != -1) return dp[index][left];
  long long int c1 = solve(index + k, left - 1) + sum[index] - sum[index - k];
  long long int c2 = solve(index + 1, left);
  if (c1 >= c2) {
    rem[index][left] = 1;
    return dp[index][left] = c1;
  }
  return dp[index][left] = c2;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> num[i + 1];
    sum[i + 1] = num[i + 1] + sum[i];
  }
  memset(dp, -1, sizeof(dp));
  long long int maxi = solve(k, 2);
  int init = k, left = 2;
  int ans[2];
  while (left) {
    if (rem[init][left]) {
      init += k;
      left--;
      ans[left] = init - 2 * k;
    } else {
      init += 1;
    }
  }
  cout << ans[1] + 1 << " " << ans[0] + 1;
  return 0;
}
