Devu being a small kid, likes to play a lot, but he only likes to play with arrays. While playing he came up with an interesting question which he could not solve, can you please solve it for him?

Given an array consisting of distinct integers. Is it possible to partition the whole array into *k* disjoint non-empty parts such that *p* of the parts have even sum (each of them must have even sum) and remaining *k* - *p* have odd sum? (note that parts need not to be continuous).

If it is possible to partition the array, also give any possible way of valid partitioning.
The first line will contain three space separated integers *n*, *k*, *p* (1 ≤ *k* ≤ *n* ≤ 10<sup class="upper-index">5</sup>; 0 ≤ *p* ≤ *k*). The next line will contain *n* space-separated distinct integers representing the content of array *a*: *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>).
if __name__ == '__main__':
    n = input()
    s = input()
    costs = input()
    costs = [int(cost) for cost in costs.split(" ")]
    ends = [0] * 4
    for i in range(len(s)):
        if s[i] == 'h':
            ends[0] += costs[i]
        if s[i] == 'a':
            ends[1] = min(ends[0], ends[1] + costs[i])
        if s[i] == 'r':
            ends[2] = min(ends[1], ends[2] + costs[i])
        if s[i] == 'd':
            ends[3] = min(ends[2], ends[3] + costs[i])
    print(min(ends))
