#include <bits/stdc++.h>
using namespace std;
char s[110], t[110], ans[110];
int n, k, l, hans;
int main() {
  while (~scanf("%d%d", &n, &k)) {
    scanf("%s%s", s, t);
    int l = strlen(s);
    memset(ans, 0, sizeof ans);
    hans = 1;
    for (int i = 0; i + l <= n && hans; i++)
      if (t[i] == '1') {
        for (int j = 0; j < l && hans; j++)
          if (ans[i + j] == 0 || ans[i + j] == s[j])
            ans[i + j] = s[j];
          else
            hans = 0;
      }
    for (int i = 0; i + l <= n && hans; i++)
      if (t[i] == '0') {
        int j;
        for (j = 0; j < l && hans; j++) {
          if (ans[i + j] && ans[i + j] != s[j]) break;
          if (ans[i + j] == 0) {
            char c;
            for (c = 'a'; c < 'a' + k; c++)
              if (c != s[j]) break;
            if (c != 'a' + k) {
              ans[i + j] = c;
              break;
            }
          }
        }
        if (j == l) hans = 0;
      }
    if (hans) {
      for (int i = 0; i < n; i++)
        if (ans[i] == 0) ans[i] = 'a';
      puts(ans);
    } else
      puts("No solution");
  }
  return 0;
}
