#include <bits/stdc++.h>
using namespace std;
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  unsigned long long c;
  while (a != 0) {
    c = a;
    a = b % a;
    b = c;
  }
  return b;
}
int z[110];
void fail(string s) {
  memset(z, 0, (int)sizeof z);
  for (int i = 1, j = 0; i < s.size(); i++) {
    while (j > 0 && s[i] != s[j]) j = z[j - 1];
    if (s[i] == s[j])
      z[i] = ++j;
    else
      z[i] = j;
  }
}
vector<int> KMPfind(string &s, string &p) {
  vector<int> res;
  for (int i = 0, j = 0; i < s.size(); i++) {
    while (j > 0 && p[j] != s[i]) j = z[j - 1];
    if (p[j] == s[i]) j++;
    if (j == p.size()) {
      res.push_back(i - p.size() + 1);
      j = z[j - 1];
    }
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  string s, ss;
  while (cin >> n >> k >> s >> ss) {
    vector<int> gg;
    for (int i = 0; i < ss.size(); i++)
      if (ss[i] == '1') gg.push_back(i);
    for (int i = 0; i < s.size() - 1; i++) ss += '0';
    string katara = ss;
    for (int i = 0; i < katara.size(); i++)
      if (ss[i] == '1') katara.replace(i, s.size(), s);
    fail(s);
    auto TRA = KMPfind(katara, s);
    if (KMPfind(katara, s) != gg) {
      cout << "No solution\n";
      continue;
    }
    bool f = 0;
    for (int i = 0; i < katara.size(); i++) {
      if (katara[i] == '0') {
        if (k == 1) {
          f = 1;
          cout << "No solution\n";
          break;
        }
        int tr = 1;
        katara[i] = 'a';
        while (gg != KMPfind(katara, s)) {
          katara[i]++;
          tr++;
        }
        if (tr > k) {
          f = 1;
          cout << "No solution\n";
          break;
        }
      }
    }
    if (!f) {
      cout << katara << "\n";
    } else
      cout << "No solution\n";
  }
  return 0;
}
