Reforms continue entering Berland. For example, during yesterday sitting the Berland Parliament approved as much as n laws (each law has been assigned a unique number from 1 to n). Today all these laws were put on the table of the President of Berland, G.W. Boosch, to be signed.

This time mr. Boosch plans to sign 2k laws. He decided to choose exactly two non-intersecting segments of integers from 1 to n of length k and sign all laws, whose numbers fall into these segments. More formally, mr. Boosch is going to choose two integers a, b (1 ≤ a ≤ b ≤ n - k + 1, b - a ≥ k) and sign all laws with numbers lying in the segments [a; a + k - 1] and [b; b + k - 1] (borders are included).

As mr. Boosch chooses the laws to sign, he of course considers the public opinion. Allberland Public Opinion Study Centre (APOSC) conducted opinion polls among the citizens, processed the results into a report and gave it to the president. The report contains the absurdity value for each law, in the public opinion. As mr. Boosch is a real patriot, he is keen on signing the laws with the maximum total absurdity. Help him.


-----Input-----

The first line contains two integers n and k (2 ≤ n ≤ 2·10^5, 0 < 2k ≤ n) — the number of laws accepted by the parliament and the length of one segment in the law list, correspondingly. The next line contains n integers x_1, x_2, ..., x_{n} — the absurdity of each law (1 ≤ x_{i} ≤ 10^9).


-----Output-----

Print two integers a, b — the beginning of segments that mr. Boosch should choose. That means that the president signs laws with numbers from segments [a; a + k - 1] and [b; b + k - 1]. If there are multiple solutions, print the one with the minimum number a. If there still are multiple solutions, print the one with the minimum b.


-----Examples-----
Input
5 2
3 6 1 1 6

Output
1 4

Input
6 2
1 1 1 1 1 1

Output
1 3



-----Note-----

In the first sample mr. Boosch signs laws with numbers from segments [1;2] and [4;5]. The total absurdity of the signed laws equals 3 + 6 + 1 + 6 = 16.

In the second sample mr. Boosch signs laws with numbers from segments [1;2] and [3;4]. The total absurdity of the signed laws equals 1 + 1 + 1 + 1 = 4.

Difficulty: interview

Starter code:

Solutions:
import sys
fin = sys.stdin

n, k = map(int, fin.readline().split())
c = list(map(int, fin.readline().split()))
s = [0] * (n + 1)
for i in range(n):
  s[i + 1] = s[i] + c[i]

ms = [i for i in range(n)]
for i in range(n - k - 1, k - 1, -1):
  s_last = s[ms[i + 1] + k] - s[ms[i + 1]]
  s_curr = s[i + k] - s[i]
  if s_curr >= s_last:
    ms[i] = i
  else:
    ms[i] = ms[i + 1]

a, b = 0, k

for i in range(n - 2 * k + 1):
  j = i + k
  sa = s[j] - s[i]
  sb = s[ms[j] + k] - s[ms[j]]
  if sa + sb > s[a + k] - s[a] + s[b + k] - s[b]:
    a, b = i, ms[j]

print(a + 1, b + 1)

import itertools
n, k = list(map(int, input().split()))
x = (0,) + tuple(itertools.accumulate(list(map(int, input().split()))))
ansa = ansb = 0
for i in range(2 * k, n + 1):
    if ansa < x[i - k] - x[i - 2 * k]:
        anst = i - 2 * k + 1; ansa = x[i - k] - x[i - 2 * k]
    if ansb < ansa + x[i] - x[i - k]:
        ans1 = anst; ans2 = i - k + 1; ansb = ansa + x[i] - x[i - k]
print(ans1, ans2)


def readInt():
    return int(input())

def readIntList():
    l = input()
    return list(map(int, l.split(" ")))

def build(tree, elem, v, l, r):
    if(l == r):
        tree[v] = elem[l]
    else:
        m = (l + r) // 2
        build(tree, elem, v * 2, l, m)
        build(tree, elem, v * 2 + 1, m + 1, r)
        tree[v] = max(tree[v * 2], tree[v * 2 + 1])

def find_max(tree, v, l, r, tl, tr):
    if(l > r):
        return (0, 10000)
    else:
        if(tl == l and tr == r):
        #   print(tl, tree[v])
            return (tree[v], tl)
        else:
            tm = (tl + tr) // 2
            m1 = find_max(tree, v * 2,     l,              min(r, tm), tl,     tm)
            m2 = find_max(tree, v * 2 + 1, max(l, tm + 1), r,          tm + 1, tr)
            if(m1[0] == m2[0]):
                if(m1[1] > m2[1]):
                    return m2
                else:
                    return m1
            else:
                if(m1[0] > m2[0]):
                    return m1
                else:
                    return m2

            #return max(m1, m2)


(n, k) = readIntList() 
laws = readIntList()

tree = 4*n*[0]

m = sum( laws [0 : k] )
n = len(laws)
maxs = [m]
for i in range(1, n - k + 1) :
    m -= laws[i - 1];
    m += laws[i + k - 1];
    maxs.append(m)

mn = len(maxs) - 1

#print(mn, maxs)
#build(tree, maxs, 1, 0, len(maxs) - 1)
#print(tree)
#print( find_max(tree, 1, 1, len(maxs) - 1, 0, len(maxs) - 1) )

#last_max = ((0, 0), (0, 0))
#last_max_i = 0
m1 = 0
m2 = 0

#for i in range(0, mn - k):
#   m1 = (maxs[i], i)
#
#   if( i + k > last_max[1][1] ):
#       m2 = find_max(tree, 1, i + k, mn - 1, 0, mn - 1)

#   if( (m1[0] + m2[0]) > last_max[0][0] + last_max[1][0] ):
#       last_max = (m1, m2)

#print( last_max )
#print( last_max[0][1] + 1, last_max[1][1] + 1 )

#print( last_max_i + k, mn - 1)
#for i in range( last_max_i + k, mn):

#   if( maxs[i] + maxs[last_max_i] == last_max ):
#       last_max_i = (last_max_i, i)
#       break

#print (last_max_i[0] + 1, last_max_i[1] + 1)
m1 = maxs[mn - k]
i1 = 0
m2 = maxs[mn]
i2 = 0
#print ( list(range(mn - k, -1, -1)) )

a = (mn + 1) * [0]

for i in range(mn - k, -1, -1):     
    if( maxs[i + k] >= m2):
        m2 = maxs[i + k]
        i2 = i + k
    a[i] = (maxs[i] + m2, i2);


#   print( i, i + k, i1, i2, maxs[i], maxs[i + k - 1])
#print(a)

ms = 0
#print(list(range(0, mn - k)))
for i in range(0, mn - k + 1):
    if(a[i][0] > ms):
        i1 = i
        i2 = a[i][1]
        ms = a[i][0]

print(i1 + 1, i2 + 1)

n, k = list(map(int, input().split()))
v = list(map(int, input().split()))
s, dp = [0 for i in range(0, n)], [0 for i in range(0, n)]
sol, a, b = 0, 0, 0

for i in range(n-1, -1, -1):
    s[i] = v[i]
    if i+1 < n: s[i] += s[i+1]
    if i+k < n: s[i] -= v[i+k]

    dp[i] = s[i]
    if i+1 < n: dp[i] = max(dp[i], dp[i+1])

for i in range(0, n):
    if i+k > n-1: break
    if s[i] + dp[i+k] > sol:
        sol = s[i] + dp[i+k]
        a = i
for b in range(a+k, n):
    if b+k > n-1: break
    if s[a] + s[b] == sol: break

#print(s)
#print(dp)
print(a+1, b+1)



n, k = map(int, input().split())
a = [0] + list(map(int, input().split()))
sums = []
for x in a: sums.append(x + sums[-1] if x > 0 else 0)
S = l = r = ans = pos = 0
for i in range(k + 1, n - k + 2):
    if sums[i - 1] - sums[i - k - 1] > S:
        S = sums[i - 1] - sums[i - k - 1]
        pos = i - k
    if S + sums[i + k - 1] - sums[i - 1] > ans:
        ans = S + sums[i + k - 1] - sums[i - 1]
        l = pos
        r = i
print(l, r)

n, k = map(int, input().split())
a = list(map(int, input().split()))
sums = [0]
for x in a: sums.append(x + sums[-1])
S = l = r = ans = pos = 0
for i in range(k, n - k + 1):
    if sums[i] - sums[i - k] > S:
        S = sums[i] - sums[i - k]
        pos = i - k
    if S + sums[i + k] - sums[i] > ans:
        ans = S + sums[i + k] - sums[i]
        l = pos
        r = i
print(l + 1, r + 1)

n, k = map(int, input().split())
a = list(map(int, input().split()))
sums = [0]
for x in a: sums.append(x + sums[-1])
S = l = r = ans = pos = 0
for i in range(k, n - k + 1):
    (prev, cur, nex) = (sums[i - k], sums[i], sums[i + k])
    if cur - prev > S:
        S = cur - prev
        pos = i - k
    if S + nex - cur > ans:
        ans = S + nex - cur
        l = pos
        r = i
print(l + 1, r + 1)

n, k = map(int, input().split())
a = list(map(int, input().split()))
sums = [0]
for x in a: sums.append(x + sums[-1])
S = l = r = ans = pos = 0
for i in range(k, n - k + 1):
    (prev, cur, nex) = (sums[i - k], sums[i], sums[i + k])
    if cur - prev > S:
        S = cur - prev
        pos = i - k
    if S + nex - cur > ans:
        ans = S + nex - cur
        l = pos
        r = i
print(l + 1, r + 1) 

n, k = map(int, input().split())
a = list(map(int, input().split()))
sums = [0]
for x in a: sums.append(x + sums[-1])
S = l = r = ans = pos = 0
for i in range(k, n - k + 1):
    (prev, cur, nex) = (sums[i - k], sums[i], sums[i + k])
    dif = cur - prev
    if dif > S:
        S = dif
        pos = i - k
    dif = nex - cur
    if S + dif > ans:
        ans = S + dif
        l = pos
        r = i
print(l + 1, r + 1)

n, k = map(int, input().split())
a = list(map(int, input().split()))
sums = [0]
for x in a: sums.append(x + sums[-1])
S = l = r = ans = pos = 0
for i in range(k, n - k + 1):
    (prev, cur, nex) = (sums[i - k], sums[i], sums[i + k])
    dif = cur - prev
    if dif > S:
        S = dif
        pos = i - k
    dif = nex - cur
    if S + dif > ans:
        ans = S + dif
        l = pos
        r = i
print(l + 1, r + 1) 

n, k = map(int, input().split())
a = list(map(int, input().split()))
sums = [0]
for x in a: sums.append(x + sums[-1]) 
S = l = r = ans = pos = 0
for i in range(k, n - k + 1):
    if sums[i] - sums[i - k] > S:
        S = sums[i] - sums[i - k]
        pos = i - k
    if S + sums[i + k] - sums[i] > ans:
        ans = S + sums[i + k] - sums[i]
        l = pos
        r = i
print(l + 1, r + 1)

import itertools
n, k = map(int, input().split())
sums = (0,) + tuple(itertools.accumulate(map(int, input().split())))
S = l = r = ans = pos = 0
for i in range(k, n - k + 1):
    if sums[i] - sums[i - k] > S:
        S = sums[i] - sums[i - k]
        pos = i - k
    if S + sums[i + k] - sums[i] > ans:
        ans = S + sums[i + k] - sums[i]
        l = pos
        r = i
print(l + 1, r + 1)

import itertools
n, k = map(int, input().split())
sums = (0,) + tuple(itertools.accumulate(map(int, input().split())))
S = l = r = ans = pos = 0
for i in range(k, n - k + 1):
    if sums[i] - sums[i - k] > S:
        S = sums[i] - sums[i - k]
        pos = i - k
    if S + sums[i + k] - sums[i] > ans:
        ans = S + sums[i + k] - sums[i] 
        l = pos
        r = i
print(l + 1, r + 1)

n, k = (int(x) for x in input().split())
x = [int(x) for x in input().split()]

s = [0]
for i in range(n):
	s.append(s[i] + x[i])

a = n - k - k + 1
sa = s[n - k] - s[a - 1]
b = n - k + 1
sb = s[n] - s[b - 1]
ans = sa + sb
ansa = a
ansb = b
ib = b

while a > 1:
	a -= 1
	sa = s[a + k - 1] - s[a - 1]
	b -= 1
	tb = s[b + k - 1] - s[b - 1]
	if tb >= sb:
		sb = tb
		ib = b
	if sa + sb >= ans:
		ansa = a
		ansb = ib
		ans = sa + sb

print(ansa, ansb)


lm = [0] * 200000
li = [0] * 200000
rm = [0] * 200000
ri = [0] * 200000

n, k = list(map(int, input().split()))

d = list(map(int, input().split()))

sm = 0
for i in range(k):
    sm += d[i]

lm[k - 1] = sm
li[i - 1] = 0

for i in range(k, n):
    sm = sm - d[i - k] + d[i]
    if sm > lm[i - 1]:
        lm[i] = sm
        li[i] = i - k + 1
    else:
        lm[i] = lm[i - 1]
        li[i] = li[i - 1]

sm = 0
for i in range(n - 1, n - 1 - k, -1):
    sm += d[i]

rm[n - k] = sm
ri[n - k] = n - k

for i in range(n - k - 1, -1, -1):
    sm = sm - d[i + k] + d[i]
    if sm >= rm[i + 1]:
        rm[i] = sm
        ri[i] = i
    else:
        rm[i] = rm[i + 1]
        ri[i] = ri[i + 1]

mx = -1
for i in range(k - 1, n - k):
    if lm[i] + rm[i + 1] > mx:
        mx = lm[i] + rm[i + 1]
        a = li[i]
        b = ri[i + 1]

print(a + 1, b + 1)


n, k = map(int, input().split())
s, t = 0, list(map(int, input().split()))

for i in range(1, n):
    t[i] += t[i - 1]
t = [t[k - 1]] + [t[i + k] - t[i] for i in range(n - k)]
p = [(t[i], i) for i in range(n - k + 1)]
p.reverse()
for i in range(1, n - k):
    if p[i][0] < p[i - 1][0]: p[i] = max(p[i], p[i - 1])
p.reverse()

a, b = 0, 0
for i in range(n - 2 * k + 1):
    if p[i + k][0] + t[i] > s:
        s = p[i + k][0] + t[i]
        a, b = i, p[i + k][1]
print(a + 1, b + 1)

read_line = lambda: list(map(int, input().split(' ')))
n, k = read_line()
x = read_line()
for i in range(n - 2, -1, -1):
    x[i] += x[i+1]
for i in range(n - k):
    x[i] -= x[i+k]
j = b = n - k
a = b - k
for i in range(a - 1, -1, -1):
    if x[i + k] >= x[j]:
        j = i + k
    if x[i] + x[j] >= x[a] + x[b]:
        a, b = i, j
print(a + 1, b + 1)


n, k = tuple(map(int, input().split(' ')))
ar = list(map(int, input().split(' ')))
t = [0]
for i in range(n):
	t.append(t[-1]+ar[i])
d = [0]*n
a = [0]*n
a1 = 0
b = k
m = 0
for i in range(k, n-k+1):
	#print(a,b,d,m)
	if t[i]-t[i-k]>d[i-1]:
		d[i] = t[i]-t[i-k]
		a[i] = i-k
	else:
		d[i] = d[i-1]
		a[i] = a[i-1]
	if d[i]+t[i+k]-t[i]>m:
		m = d[i]+t[i+k]-t[i]
		a1 = a[i]
		b = i
#print(a,b,d,m)
print('{0} {1}'.format(a1+1,b+1))


n, k = map(int, input().split())
s, t = 0, list(map(int, input().split()))

for i in range(1, n):
    t[i] += t[i - 1]
t = [t[k - 1]] + [t[i + k] - t[i] for i in range(n - k)]
p = [(t[i], i) for i in range(n - k + 1)]
p.reverse()
for i in range(1, n - k):
    if p[i][0] < p[i - 1][0]: p[i] = max(p[i], p[i - 1])
p.reverse()

a, b = 0, 0
for i in range(n - 2 * k + 1):
    if p[i + k][0] + t[i] > s:
        s = p[i + k][0] + t[i]
        a, b = i, p[i + k][1]
print(a + 1, b + 1)

n, k = [int(x) for x in input().split()]

absurd_scores = [int(x) for x in input().split()]

partial_sums = [0]


for idx in range(len(absurd_scores)):
    partial_sums.append(partial_sums[-1] + absurd_scores[idx])
    
# print(partial_sums)


a = n - 2 * k
b = n - k

max_sum = partial_sums[n] - partial_sums[n - 2 * k]

cur_top_idx = n - k 
cur_top_max = partial_sums[n] - partial_sums[n - k]

# print(max_sum)
# print(cur_top_max)

for i in reversed(list(range(n - 2 * k))):
    
    new_top_idx = i + k
    
#     print(new_top_idx)
    
    new_top_sum = partial_sums[new_top_idx + k] - partial_sums[new_top_idx]
    
    if new_top_sum >= cur_top_max:
        cur_top_max = new_top_sum
        cur_top_idx = new_top_idx
    
    new_low_idx = i
#     print(new_low_idx, new_low_idx + k - 1)
    
    new_sum = partial_sums[new_low_idx + k] - partial_sums[new_low_idx] + cur_top_max
    
    if new_sum >= max_sum:
        a = new_low_idx
        b = cur_top_idx
        max_sum = new_sum
        
print(a + 1, b + 1)
    
    
  
#Edge Cases

'''
Must cover entire range [1 4 5 6] for len 2
Smallest idx is 2nd largest value
Can't be greedy taking the max one immediately [2 1 99 100 98] for len 2
'''



n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
sums = [0]
for x in a: sums.append(x + sums[-1]) 
S = l = r = ans = pos = 0
for i in range(k, n - k + 1):
    if sums[i] - sums[i - k] > S:
        S = sums[i] - sums[i - k]
        pos = i - k
    if S + sums[i + k] - sums[i] > ans:
        ans = S + sums[i + k] - sums[i]
        l = pos
        r = i
print(l + 1, r + 1)


def main():
    from itertools import accumulate
    n, k = list(map(int, input().split()))
    l = [0]
    l.extend(accumulate(list(map(int, input().split()))))
    ma = mab = 0
    for i, x, y, z in zip(list(range(1, n)), l, l[k:], l[k * 2:]):
        if ma < y - x:
            t, ma = i, y - x
        if mab < ma + z - y:
            a, b, mab = t, i, ma + z - y
    print(a, b + k)


def __starting_point():
    main()

__starting_point()