#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
const int MOD = 1000000007;
const int INF = 0x3fffffff;
typedef struct Node {
  long long v;
  int p;
  Node(long long v_, int p_) {
    v = v_;
    p = p_;
  }
  bool operator<(const Node& other) const {
    return v < other.v || (v == other.v && p > other.p);
  }
} Node;
long long a[N];
int main() {
  ios::sync_with_stdio(false);
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) {
    scanf("%I64d", &a[i]);
    a[i] += a[i - 1];
  }
  priority_queue<Node> Q;
  Q.push(Node(a[n] - a[n - k], n + 1 - k));
  long long ans = 0;
  int ansa, ansb;
  int q = n + 1 - k;
  for (int i = n + 1 - k - k; i > 0; --i) {
    if (ans <= Q.top().v + a[i + k - 1] - a[i - 1]) {
      ans = Q.top().v + a[i + k - 1] - a[i - 1];
      ansa = i;
      ansb = Q.top().p;
    }
    --q;
    Q.push(Node(a[q + k - 1] - a[q - 1], q));
  }
  printf("%d %d\n", ansa, ansb);
  return 0;
}
