Ada the Ladybug has two string which she wants to give to her friends. As she doesn't want to distinguish between them, she wants to use only some common subsequence. Firstly she wanted to simply use the longest common subsequence but then she realized it wouldn't be kosher.

She assigned a positive value to each letter. Now she wants to find the most expensive subsequence.

### Input

The first line of each test-case will contain two integers 1 ≤ N, M ≤ 2000, the length of each subsequence.

The next line will contain 26 integers (1 ≤ Pi ≤ 105), the price of each letter.

The next line will contain string of length N consisting of lowercase english alphabet.

The next line will contain string of length M consisting of lowercase english alphabet.

### Output

For each test-case, print the cost of the most expensive common subsequence.

### Example Input

```4 4
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
abcd
dbca
```

```2
```

### Example Input

```3 3
1 7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
baa
aab
```

```7
```

### Example Input

```4 5
1 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 6
zbbz
bbzbb
```

```14
```

### Example Input

```3 3
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
abc
def
```

```0
```