#include <bits/stdc++.h>
using namespace std;
long long dp[10001];
set<pair<long long, long long>> s;
set<long long> X, Y;
void solve(long long op, long long cl, string output, vector<string> &v) {
  if (op == 0 && cl == 0) {
    v.push_back(output);
  }
  if (op != 0) {
    string op1 = output;
    op1.push_back('(');
    solve(op - 1, cl, op1, v);
  }
  if (cl > op) {
    string op1 = output;
    op1.push_back(')');
    solve(op, cl - 1, op1, v);
  }
  return;
}
vector<string> fun(long long n) {
  vector<string> v;
  long long op = n;
  long long cl = n;
  string output = "";
  solve(op, cl, output, v);
  return v;
}
bool check(long long a[], long long n) {
  for (long long i = 0; i < n - 1; i++) {
    if (a[i] < a[i + 1]) return false;
  }
  return true;
}
long long countOddSquares(long long n, long long m) {
  return (long long)pow(m, 0.5) - (long long)pow(n - 1, 0.5);
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  {
    long long t;
    t = 1;
    while (t--) {
      long long n, k;
      cin >> n >> k;
      long long a[n + 1];
      for (long long i = 1; i < n + 1; i++) {
        cin >> a[i];
        if (i != 0) a[i] = a[i] + a[i - 1];
      }
      long long l = n - k, r = n, j = n;
      for (long long i = n - k; i >= k; i--) {
        if (a[i + k] - a[i] >= a[j] - a[j - k]) {
          j = i + k;
        }
        if (a[i] - a[i - k] + a[j] - a[j - k] >=
            a[l] - a[l - k] + a[r] - a[r - k]) {
          l = i;
          r = j;
        }
      }
      cout << l - k + 1 << " " << r - k + 1;
    }
  }
}
