#include <bits/stdc++.h>
using namespace std;
int cnt[26];
int cnt2[26];
int done[26];
int main(void) {
  string s, t;
  vector<int> pos;
  cin >> s >> t;
  int pp = 0;
  for (auto c : s) {
    if (c != '?')
      cnt[c - 'a']++;
    else if (c == '?')
      pos.push_back(pp);
    pp++;
  }
  for (auto c : t) cnt2[c - 'a']++;
  int ans = 0;
  int lo = 1, hi = (int)s.size() / (int)t.size();
  while (lo <= hi) {
    int mid = (lo + hi) / 2;
    int q = (int)pos.size();
    memset(done, 0, sizeof(done));
    int flag = 1;
    for (auto c : t) {
      if (flag == 0) break;
      if (done[c - 'a']) continue;
      done[c - 'a'] = 1;
      int need = cnt2[c - 'a'] * mid;
      if (cnt[c - 'a'] < need) {
        if (q < need - cnt[c - 'a'])
          flag = 0;
        else
          q -= need - cnt[c - 'a'];
      }
    }
    if (flag)
      ans = mid, lo = mid + 1;
    else
      hi = mid - 1;
  }
  memset(done, 0, sizeof(done));
  for (auto c : t) {
    if (done[c - 'a']) continue;
    done[c - 'a'] = 1;
    int need = max(0, ans * cnt2[c - 'a'] - cnt[c - 'a']);
    for (int i = 0; i < need; i++) {
      s[pos.back()] = c;
      pos.pop_back();
    }
  }
  for (auto c : s) {
    if (c == '?')
      putchar('a');
    else
      putchar(c);
  }
  cout << endl;
  return 0;
}
