#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <algorithm>
#define MAXN 200000
using namespace std;
long long input[MAXN + 2],
sum[MAXN + 2];
int main() {
#ifdef mahfuz
freopen("input", "r", stdin);
#endif
int n, k;
long long r, sum_sofar, l, a, b, maxb;
cin >> n >> k;
cin >> input[0];
sum[0] = input[0];
for(int i = 1; i < n; i++) {
cin >> input[i];
sum[i] = sum[i - 1] + input[i];
}
r = sum[n - 1] - sum[n - k - 1];
sum_sofar = sum[n - 1] - sum[n - 2*k - 1];
for(int i = n - 2 * k; i >= 0; i--) {
if(r <= sum[i + 2*k - 1] - sum[i + k - 1]) {
r = sum[i + 2*k - 1] - sum[i + k - 1];
maxb = i + k;
}
//r = max(r, sum[i + 2*k - 1] - sum[i + k - 1]);
l = sum[i + k - 1] - sum[i - 1];
if(sum_sofar <= l + r) {
sum_sofar = l + r;
a = i;
b = maxb;
}
//cout << i << " " << l << " " << r << " " << sum_sofar << endl;
}
cout << a + 1 << " " << b + 1 << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y3N0ZGlvPgojaW5jbHVkZSA8Y3N0cmluZz4KI2luY2x1ZGUgPHN0cmluZz4KI2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPHF1ZXVlPgojaW5jbHVkZSA8c3RhY2s+CiNpbmNsdWRlIDxjbWF0aD4KI2luY2x1ZGUgPGFsZ29yaXRobT4KCiNkZWZpbmUgTUFYTiAyMDAwMDAKCnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgpsb25nIGxvbmcgaW5wdXRbTUFYTiArIDJdLAogICAgICAgICAgc3VtW01BWE4gKyAyXTsKCmludCBtYWluKCkgewogICAgI2lmZGVmIG1haGZ1egogICAgZnJlb3BlbigiaW5wdXQiLCAiciIsIHN0ZGluKTsKICAgICNlbmRpZgoKICAgIGludCBuLCBrOwogICAgbG9uZyBsb25nIHIsIHN1bV9zb2ZhciwgbCwgYSwgYiwgbWF4YjsKICAgIGNpbiA+PiBuID4+IGs7CgogICAgY2luID4+IGlucHV0WzBdOwogICAgc3VtWzBdID0gaW5wdXRbMF07CgogICAgZm9yKGludCBpID0gMTsgaSA8IG47IGkrKykgewogICAgICAgIGNpbiA+PiBpbnB1dFtpXTsKICAgICAgICBzdW1baV0gPSBzdW1baSAtIDFdICsgaW5wdXRbaV07CiAgICB9CgogICAgciA9IHN1bVtuIC0gMV0gLSBzdW1bbiAtIGsgLSAxXTsKICAgIHN1bV9zb2ZhciA9IHN1bVtuIC0gMV0gLSBzdW1bbiAtIDIqayAtIDFdOwoKICAgIGZvcihpbnQgaSA9IG4gLSAyICogazsgaSA+PSAwOyBpLS0pIHsKICAgICAgICBpZihyIDw9IHN1bVtpICsgMiprIC0gMV0gLSBzdW1baSArIGsgLSAxXSkgewogICAgICAgICAgICByID0gc3VtW2kgKyAyKmsgLSAxXSAtIHN1bVtpICsgayAtIDFdOwogICAgICAgICAgICBtYXhiID0gaSArIGs7CiAgICAgICAgfQoKICAgICAgICAvL3IgPSBtYXgociwgc3VtW2kgKyAyKmsgLSAxXSAtIHN1bVtpICsgayAtIDFdKTsKICAgICAgICBsID0gc3VtW2kgKyBrIC0gMV0gLSBzdW1baSAgLSAxXTsKCiAgICAgICAgaWYoc3VtX3NvZmFyIDw9IGwgKyByKSB7CiAgICAgICAgICAgIHN1bV9zb2ZhciA9IGwgKyByOwogICAgICAgICAgICBhID0gaTsKICAgICAgICAgICAgYiA9IG1heGI7CiAgICAgICAgfQoKICAgICAgICAvL2NvdXQgPDwgaSA8PCAiICIgPDwgbCA8PCAiICIgPDwgciA8PCAiICIgPDwgc3VtX3NvZmFyIDw8IGVuZGw7CiAgICB9CgogICAgY291dCA8PCBhICsgMSA8PCAiICIgPDwgYiArIDEgPDwgZW5kbDsKCiAgICByZXR1cm4gMDsKfQo=