#!/usr/bin/python3
unused, stitch, startend = [int(x) for x in input().split()]
w = input()
p = input()

for color in w:
    cost = 0
    i = 0
    while i < len(p):
        if p[i] == color:
            cost += 2 * startend
            while i < len(p) and p[i] == color:
                cost += stitch
                i += 1
        else:
            i += 1

    print(cost)
