#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long long MAX = 1e5 + 10;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  while (t--) {
    int n, k;
    cin >> n >> k;
    vector<long long> a(n + 7), l(n + 7, 0), r(n + 7, 0);
    a[0] = 0;
    for (int i = 1; i < n + 1; i++) {
      cin >> a[i];
      a[i] += a[i - 1];
      if (i >= k) l[i] = max(l[i - 1], a[i] - a[i - k]);
    }
    for (int i = n; i >= k; i--) {
      r[i] = max(r[i + 1], a[i] - a[i - k]);
    }
    long long to = 0;
    int p = -1, q = -1;
    for (int i = k; i < n - k + 1; i++) {
      if (l[i] + r[i + k] > to) {
        p = i - k + 1, q = i + k, to = l[i] + r[i + k];
      }
    }
    for (int i = q; i < n + 1; i++)
      if (a[i] - a[i - k] == to - l[p + k - 1]) {
        q = i - k + 1;
        break;
      }
    cout << p << " " << q;
  }
}
