#include <bits/stdc++.h>
using namespace std;
struct Node {
  long long sum;
  int index;
  bool operator<(const Node &a) const {
    if (sum == a.sum) return index < a.index;
    return sum > a.sum;
  }
};
Node nodes[200010];
long long sum[200010];
int a[200010];
int b[200010];
int main() {
  int n, k;
  while (scanf("%d%d", &n, &k) != -1) {
    int cnt = 1;
    nodes[0].index = 0;
    nodes[0].sum = 0;
    long long _max;
    int _max_index = 0;
    for (int i = 0; i < n; i++) {
      scanf("%d", &a[i]);
      if (i < k) {
        nodes[0].sum += (long long)a[i];
        _max = nodes[0].sum;
      } else {
        nodes[cnt].index = cnt;
        nodes[cnt].sum =
            nodes[cnt - 1].sum - (long long)a[i - k] + (long long)a[i];
        cnt++;
      }
    }
    sum[0] = nodes[0].sum;
    b[0] = 0;
    for (int i = 1; i < cnt; i++) {
      if (sum[i - 1] < nodes[i].sum) {
        b[i] = i;
        sum[i] = nodes[i].sum;
      } else {
        sum[i] = sum[i - 1];
        b[i] = b[i - 1];
      }
    }
    int ans1, ans2;
    ans1 = 1, ans2 = k + 1;
    _max = nodes[k].sum + sum[0];
    for (int i = k + 1; i < cnt; i++) {
      if (nodes[i].sum + sum[i - k] > _max) {
        ans1 = b[i - k] + 1;
        ans2 = i + 1;
        _max = nodes[i].sum + sum[i - k];
      }
    }
    cout << ans1 << " " << ans2 << endl;
  }
  return 0;
}
