#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 5;
int n, k, len, ans[maxn], name[maxn], a[maxn];
char s[maxn];
bool can;
void init() {
  scanf("%d%d\n", &n, &k);
  gets(s);
  len = strlen(s);
  for (int i = 1; i <= len; i++) name[i] = s[i - 1] - 'a' + 1;
  for (int i = 1; i <= n - len + 1; i++) a[i] = getchar() - '0';
}
bool check(int pos) {
  int l = max(1, pos - len + 1);
  int r = min(n - len + 1, pos);
  for (int i = l; i <= r; i++) {
    bool yes = true;
    for (int j = 1; j <= len && yes; j++)
      if (ans[i + j - 1] != name[j]) yes = false;
    if (yes) return false;
  }
  return true;
}
void solve() {
  can = true;
  for (int i = 1; i <= len; i++)
    if (name[i] > k) {
      can = false;
      return;
    }
  memset(ans, -1, sizeof(ans));
  for (int i = 1; i <= n - len + 1; i++) {
    if (a[i] == 0) continue;
    for (int j = 1; j <= len; j++) {
      if (ans[i + j - 1] == -1 || ans[i + j - 1] == name[j])
        ans[i + j - 1] = name[j];
      else {
        can = false;
        return;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (ans[i] == -1) {
      for (int j = 1; j <= k; j++) {
        ans[i] = j;
        if (check(i)) break;
        ans[i] = -1;
      }
      if (ans[i] == -1) {
        can = false;
        return;
      }
    }
  }
  for (int i = 1; i <= n - len + 1; i++) {
    if (a[i] == 1) continue;
    bool yes = true;
    for (int j = 1; j <= len && yes; j++)
      if (ans[i + j - 1] != name[j]) yes = false;
    if (yes) {
      can = false;
      return;
    }
  }
}
void print() {
  if (can) {
    for (int i = 1; i <= n; i++) putchar(ans[i] + 'a' - 1);
    putchar('\n');
  } else
    puts("No solution");
}
int main() {
  init();
  solve();
  print();
  return 0;
}
