#include <bits/stdc++.h>
using namespace std;
bool customS(pair<int64_t, int64_t> a, pair<int64_t, int64_t> b) {
  if (a.second == b.second) return a.first < b.first;
  return a.second < b.second;
}
bool customS2(vector<int> a, vector<int> b) {
  int t1 = a.size(), t2 = b.size();
  return t1 < t2;
}
class CompareDist {
 public:
  bool operator()(pair<int64_t, int64_t> a, pair<int64_t, int64_t> b) {
    if (a.second == b.second) return a.first > b.first;
    return a.second > b.second;
  }
};
int64_t gcd(int64_t a, int64_t b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
double gcdfloat(double a, double b) {
  if (a < b) return gcd(b, a);
  if (fabs(b) < 0.001)
    return a;
  else
    return (gcd(b, a - floor(a / b) * b));
}
int main() {
  int64_t n, k, i, j;
  cin >> n >> k;
  vector<int64_t> arr(n);
  vector<int64_t> dp_1(n, 0);
  vector<int64_t> dp_2(n, 0);
  vector<int64_t> dp_3(n, 0);
  for (i = 0; i < n; i++) {
    cin >> arr[i];
  }
  int64_t running_sum = 0;
  for (i = 0; i < k - 1; i++) running_sum += arr[i];
  for (i = k - 1; i < n; i++) {
    running_sum += arr[i];
    dp_1[i] = running_sum;
    running_sum -= arr[i - k + 1];
  }
  running_sum = 0;
  for (i = n - 1; i > (n - k); i--) running_sum += arr[i];
  for (i = n - k; i >= 0; i--) {
    running_sum += arr[i];
    dp_2[i] = running_sum;
    dp_3[i] = running_sum;
    running_sum -= arr[i + k - 1];
  }
  for (i = 1; i < n; i++) {
    if (dp_1[i] < dp_1[i - 1]) {
      dp_1[i] = dp_1[i - 1];
    }
  }
  for (i = n - 2; i >= 0; i--) {
    if (dp_2[i] < dp_2[i + 1]) {
      dp_2[i] = dp_2[i + 1];
    }
  }
  int64_t maxi_value = INT64_MIN, a, b;
  for (i = k - 1; i + 1 <= (n - k); i++) {
    if (dp_1[i] + dp_2[i + 1] > maxi_value) {
      maxi_value = dp_1[i] + dp_2[i + 1];
      a = dp_1[i];
      b = dp_2[i + 1];
    }
  }
  for (i = 0; i < n; i++) {
    if (dp_1[i] == a) {
      break;
    }
  }
  for (j = i + 1; j < n; j++) {
    if (dp_3[j] == b) {
      break;
    }
  }
  cout << i + 1 - k + 1 << " " << j + 1 << "\n";
  return 0;
}
