Arkady decided to buy roses for his girlfriend.

A flower shop has white, orange and red roses, and the total amount of them is n. Arkady thinks that red roses are not good together with white roses, so he won't buy a bouquet containing both red and white roses. Also, Arkady won't buy a bouquet where all roses have the same color. 

Arkady wants to buy exactly k roses. For each rose in the shop he knows its beauty and color: the beauty of the i-th rose is bi, and its color is ci ('W' for a white rose, 'O' for an orange rose and 'R' for a red rose). 

Compute the maximum possible total beauty of a bouquet of k roses satisfying the constraints above or determine that it is not possible to make such a bouquet.

Input

The first line contains two integers n and k (1 ≤ k ≤ n ≤ 200 000) — the number of roses in the show and the number of roses Arkady wants to buy.

The second line contains a sequence of integers b1, b2, ..., bn (1 ≤ bi ≤ 10 000), where bi equals the beauty of the i-th rose.

The third line contains a string c of length n, consisting of uppercase English letters 'W', 'O' and 'R', where ci denotes the color of the i-th rose: 'W' denotes white, 'O' — orange, 'R' — red.

Output

Print the maximum possible total beauty of a bouquet of k roses that satisfies the constraints above. If it is not possible to make a single such bouquet, print -1.

Examples

Input

5 3
4 3 4 1 6
RROWW


Output

11


Input

5 2
10 20 14 20 11
RRRRR


Output

-1


Input

11 5
5 6 3 2 3 4 7 5 4 5 6
RWOORWORROW


Output

28

Note

In the first example Arkady wants to buy 3 roses. He can, for example, buy both red roses (their indices are 1 and 2, and their total beauty is 7) and the only orange rose (its index is 3, its beauty is 4). This way the total beauty of the bouquet is 11. 

In the second example Arkady can not buy a bouquet because all roses have the same color.
n,k = map(int, input().split())
b = list(map(int,input().split()))

SSSSSSSSSS = input()

INF = 1000*1000*1000+123
RRRR = [];
WWWWWWW = [];
OOOOOOOOO = [];

for i in range(n):
    if SSSSSSSSSS[i] == 'R':
        RRRR.append(b[i])
    elif SSSSSSSSSS[i] == 'W':
        WWWWWWW.append(b[i])
    else:
        OOOOOOOOO.append(b[i])



WWWWWWW.sort()

RRRR.sort()
WWWWWWW.reverse()
RRRR.reverse()
OOOOOOOOO.sort()
OOOOOOOOO.reverse()

if k == 1:
    print(-1)
    exit(0)


def cccmcmc(A, B):
    qanakA = len(A);
    qanakB = len(B);

    pA = [0 for i in range(qanakA)]
    pB = [0 for i in range(qanakB)]
    pB[0] = B[0]
    pA[0] = A[0]

    for i in range(1,qanakA):
        pA[i] = pA[i-1] + A[i];
    for i in range(1,qanakB):
        pB[i] = pB[i-1] + B[i];

    res = -1

    for i in range(1,min(qanakA+1,k)):
        aic = pA[i-1]
        bepetk = k-i
        if bepetk <= 0 or bepetk > qanakB: continue
        bic = pB[bepetk-1]
        res = max(res,aic+bic)
    return res


res = -1

if len(WWWWWWW) > 0 and len(OOOOOOOOO)> 0:
    res = max(res, cccmcmc(WWWWWWW, OOOOOOOOO))
if len(RRRR) > 0 and len(OOOOOOOOO)> 0:
    res = max(res, cccmcmc(RRRR, OOOOOOOOO))

print(res)
