#include <bits/stdc++.h>
using namespace std;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, -1, 0, 1};
const double EPS = 1e-9;
struct State {
  long long from;
  long long sum;
  State(long long from, long long sum) : from(from), sum(sum) {}
};
bool operator<(const State &left, const State &right) {
  if (left.sum == right.sum) {
    return left.from > right.from;
  }
  return left.sum < right.sum;
}
bool operator>(const State &left, const State &right) {
  if (left.sum == right.sum) {
    return left.from < right.from;
  }
  return left.sum > right.sum;
}
int main() {
  long long n, k;
  cin >> n >> k;
  vector<long long> X(n);
  for (int i = 0; i < n; i++) {
    cin >> X[i];
  }
  vector<long long> sums(n - k + 1);
  for (int i = 0; i < k; i++) {
    sums[0] += X[i];
  }
  for (int i = 1; i < sums.size(); i++) {
    sums[i] = sums[i - 1] - X[i - 1] + X[i + k - 1];
  }
  priority_queue<State> que;
  for (int i = 0; i < sums.size(); i++) {
    que.push(State(i, sums[i]));
  }
  long long ret = -1;
  long long reta = -1;
  long long retb = -1;
  for (int na = 0; na < sums.size(); na++) {
    while (not que.empty()) {
      int nb = que.top().from;
      if (nb <= na + k - 1) {
        que.pop();
        continue;
      } else if (que.top().sum + sums[na] > ret) {
        reta = na;
        retb = nb;
        ret = que.top().sum + sums[na];
        break;
      } else {
        break;
      }
    }
  }
  cout << reta + 1 << " " << retb + 1 << endl;
  return 0;
}
