926_H. Endless Roses Most Beautiful
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.
```python
n,k=map(int,input().split())
b=list(map(int,input().split()))
s=input()
a=[]
if k==1:
    print(-1)
    exit()
for i in range(n):
    a.append((b[i],s[i]))
a.sort(reverse=True)
i=0
j=0
m1=0
q1=False
q2=False
while i!=k:
    if a[j][1]!='R':
        m1+=a[j][0]
        g=j+0
        if a[j][1]=='W':
            q1=True
        else:
            q2=True
        i+=1
    j+=1
    if j==n and i!=k:
        m1=0
        break
else:
    if not (q1 and q2):
        m1-=a[g][0]
        for i in range(g+1,n):
            if q1 and a[i][1]=='O' or q2 and a[i][1]=='W':
                m1+=a[i][0]
                break
        else:
            m1=0
i=0
j=0
m2=0
q1=False
q2=False
while i!=k:
    if a[j][1]!='W':
        m2+=a[j][0]
        g=j+0
        if a[j][1]=='R':
            q1=True
        else:
            q2=True
        i+=1
    j+=1
    if j==n and i!=k:
        m2=0
        break
else:
    if not (q1 and q2):
        m2-=a[g][0]
        for i in range(g+1,n):
            if q1 and a[i][1]=='O' or q2 and a[i][1]=='R':
                m2+=a[i][0]
                break
        else:
            m2=0
if m1 or m2:
    print(max(m1,m2))
else:
    print(-1)
    
    
    
        

```