import sys input = sys.stdin.readline L,K=map(int,input().split()) S=input().strip() T=input().strip() mod=998244353 S2=[] T2=[] for s in S: S2.append(ord(s)-97) for t in T: T2.append(ord(t)-97) A=list(map(int,input().split())) SUM=sum(A) INV=pow(SUM,mod-2,mod) DP=[[0]*(K+1) for i in range(K+1)] DP[0][0]=1 for tt in range(K): NDP=[[0]*(K+1) for i in range(K+1)] for i in range(tt+1): for j in range(tt+1): if abs(i-j)==L: NDP[i][j]+=DP[i][j] if i