# include<iostream>
# include<algorithm>
# include<cstring>
# include<string>
# include<cmath>
# include<queue>
# include<stack>
# include<set>
# include<vector>
# include<cstdio>
# include<cstdlib>
# include<map>

# define deb(x) printf("# x=%d\n",x)
# define deb_d(x) printf("# x=%lf\n",x)
# define ccout(x) printf("%d\n",x)

typedef long long ll;

using namespace std;

const int maxsize=1e6+10;

struct node{
	int num1;
	int num2;
	double data;
	int loc;
	bool operator<(const node &a)const{
		return data>a.data;
	}
	void Set(int a,int b,double c,int d);
};

priority_queue<node> q;

char s[maxsize],t[maxsize];
int cnt;
int num1[30],num2[30];
int pos[maxsize];

void node::Set(int a,int b,double c,int d){
	num1=a;
	num2=b;
	data=c;
	loc=d;
}

void handle(const int &xx){
	double Min=1e9+10,tmp;
	int x;
	for(int i=0;i<26;i++){
		if(num2[i]>0){
			tmp=(num1[i]*1.0)/num2[i];
			if(tmp<Min){
				Min=tmp;
				x=i;
			}
		}
	}
	s[pos[xx]]=x+'a';
	num1[x]++;
}

int main(void){
	node  now;
	scanf("%s %s",s,t);
	if(strlen(s)<=strlen(t)){
		for(int i=0;i<strlen(s);i++){
			if(s[i]=='?'){
				s[i]=t[i];
			}
		}
		puts(s);
		return 0;
	}
	cnt=0;
	memset(num1,0,sizeof(num1));
	memset(num2,0,sizeof(num2));
	for(int i=0;i<strlen(s);i++){
		if(s[i]=='?'){
			pos[cnt++]=i;
		}
		else
			num1[s[i]-'a']++;
	}
	for(int i=0;i<strlen(t);i++){
		num2[t[i]-'a']++;
	}
	for(int i=0;i<26;i++){
		if(num2[i]>0){
			now.Set(num1[i],num2[i],(num1[i]*1.0)/num2[i],i);
			q.push(now);
		}
	}
	int tmp1,tmp2;
	int xx;
	for(int i=0;i<cnt;i++){
		//s[pos[i]]=q.top().loc+'a';
		//xx=q.top().loc;
		//tmp1=q.top().num1+1;
		//tmp2=q.top().num2;
		//now.Set(tmp1,tmp2,(tmp1*1.0)/tmp2,xx);
		//q.pop();
		//q.push(now);
		handle(i);
	}
	puts(s);
	return 0;
}


# include<iostream>
# include<algorithm>
# include<cstring>
# include<string>
# include<cmath>
# include<queue>
# include<stack>
# include<set>
# include<vector>
# include<cstdio>
# include<cstdlib>
# include<map>

# define deb(x) printf("# x=%d\n",x)
# define deb_d(x) printf("# x=%lf\n",x)
# define ccout(x) printf("%d\n",x)

typedef long long ll;

using namespace std;

const int maxsize=1e6+10;
double eps=1e-8;

struct node{
	double num1;
	double num2;
	double data;
	double loc;
	bool operator<(const node &a)const{
		if(data>a.data)
			return 1;
		else if(data==a.data&&num2>a.num2)
			return 1;
		return 0;
	}
	void Set(double a,double b,double c,double d);
};

priority_queue<node> q;

char s[maxsize],t[maxsize];
int cnt;
double num1[30],num2[30];
int pos[maxsize];

void node::Set(double a,double b,double c,double d){
	num1=a;
	num2=b;
	data=c;
	loc=d;
}

void handle(const int &xx){
	double Min=1e9+10,tmp;
	int x;
	for(int i=0;i<26;i++){
		if(num2[i]>0){
			tmp=(num1[i]*1.0)/num2[i];
			if(tmp<Min){
				Min=tmp;
				x=i;
			}
		}
	}
	s[pos[xx]]=x+'a';
	num1[x]++;
}

int main(void){
	node  now;
	scanf("%s %s",s,t);
	if(strlen(s)<=strlen(t)){
		for(int i=0;i<strlen(s);i++){
			if(s[i]=='?'){
				s[i]=t[i];
			}
		}
		puts(s);
		return 0;
	}
	cnt=0;
	memset(num1,0,sizeof(num1));
	memset(num2,0,sizeof(num2));
	for(int i=0;i<strlen(s);i++){
		if(s[i]=='?'){
			pos[cnt++]=i;
		}
		else
			num1[s[i]-'a']++;
	}
	for(int i=0;i<strlen(t);i++){
		num2[t[i]-'a']++;
	}
	for(int i=0;i<26;i++){
		if(num2[i]>0){
			now.Set(num1[i],num2[i],num1[i]/num2[i],i);
			q.push(now);
		}
	}
	double tmp1,tmp2;
	int xx;
	for(int i=0;i<cnt;i++){
		xx=q.top().loc;
		s[pos[i]]=xx+'a';
		tmp1=q.top().num1+1;
		tmp2=q.top().num2;
		now.Set(tmp1,tmp2,tmp1*1.0/tmp2,xx);
		q.pop();
		q.push(now);
	}
	puts(s);
	return 0;
}


# include<iostream>
# include<algorithm>
# include<cstring>
# include<string>
# include<cmath>
# include<queue>
# include<stack>
# include<set>
# include<vector>
# include<cstdio>
# include<cstdlib>
# include<map>

# define deb(x) printf("# x=%d\n",x)
# define deb_d(x) printf("# x=%lf\n",x)
# define ccout(x) printf("%d\n",x)

typedef long long ll;

using namespace std;

const int maxsize=1e6+10;

char s[maxsize],t[maxsize];
int cnt;
int num1[30],num2[30];
int pos[maxsize];

void handle(const int &i){
	double Min=1e9+10,tmp;
	int x;
	for(int i=0;i<26;i++){
		if(num2[i]>0){
			tmp=(num1[i]*1.0)/num2[i];
			if(tmp<Min){
				Min=tmp;
				x=i;
			}
		}
	}
	s[pos[i]]=x+'a';
	num1[x]++;
}

int main(void){
	gets(s);
	gets(t);
	if(strlen(s)<=strlen(t)){
		for(int i=0;i<strlen(s);i++){
			if(s[i]=='?'){
				putchar(t[i]);
			}
			else{
				putchar(s[i]);
			}
		}
		printf("\n");
	}
	cnt=0;
	memset(num1,0,sizeof(num1));
	memset(num2,0,sizeof(num2));
	for(int i=0;i<strlen(s);i++){
		if(s[i]=='?'){
			pos[cnt++]=i;
		}
		else
			num1[s[i]-'a']++;
	}
	for(int i=0;i<strlen(t);i++){
		num2[t[i]-'a']++;
	}
	for(int i=0;i<cnt;i++){
		handle(i);
	}
	printf("%s\n",s);
	return 0;
}


# include<iostream>
# include<algorithm>
# include<cstring>
# include<string>
# include<cmath>
# include<queue>
# include<stack>
# include<set>
# include<vector>
# include<cstdio>
# include<cstdlib>
# include<map>

# define deb(x) printf("# x=%d\n",x)
# define deb_d(x) printf("# x=%lf\n",x)
# define ccout(x) printf("%d\n",x)

typedef long long ll;

using namespace std;

const int maxsize=1e6+10;
double eps=1e-8;

struct node{
	int num1;
	int num2;
	double data;
	int loc;
	bool operator<(const node &a)const{
		if(data>a.data)
			return 1;
		else if(data==a.data&&loc>a.loc)
			return 1;
		return 0;
	}
	void Set(int a,int b,double c,int d);
};

priority_queue<node> q;

char s[maxsize],t[maxsize];
int cnt;
int num1[30],num2[30];
int pos[maxsize];

void node::Set(int a,int b,double c,int d){
	num1=a;
	num2=b;
	data=c;
	loc=d;
}

void handle(const int &xx){
	double Min=1e9+10,tmp;
	int x;
	for(int i=0;i<26;i++){
		if(num2[i]>0){
			tmp=(num1[i]*1.0)/num2[i];
			if(tmp<Min){
				Min=tmp;
				x=i;
			}
		}
	}
	s[pos[xx]]=x+'a';
	num1[x]++;
}

int main(void){
	node  now;
	scanf("%s %s",s,t);
	if(strlen(s)<=strlen(t)){
		for(int i=0;i<strlen(s);i++){
			if(s[i]=='?'){
				s[i]=t[i];
			}
		}
		puts(s);
		return 0;
	}
	cnt=0;
	memset(num1,0,sizeof(num1));
	memset(num2,0,sizeof(num2));
	for(int i=0;i<strlen(s);i++){
		if(s[i]=='?'){
			pos[cnt++]=i;
		}
		else
			num1[s[i]-'a']++;
	}
	for(int i=0;i<strlen(t);i++){
		num2[t[i]-'a']++;
	}
	for(int i=0;i<26;i++){
		if(num2[i]>0){
			now.Set(num1[i],num2[i],(num1[i]*1.0)/num2[i]+eps,i);
			q.push(now);
		}
	}
	int tmp1,tmp2;
	int xx;
	for(int i=0;i<cnt;i++){
		s[pos[i]]=q.top().loc+'a';
		xx=q.top().loc;
		tmp1=q.top().num1+1;
		tmp2=q.top().num2;
		now.Set(tmp1,tmp2,(tmp1*1.0)/tmp2+eps,xx);
		q.pop();
		q.push(now);
	}
	puts(s);
	return 0;
}


# include<iostream>
# include<algorithm>
# include<cstring>
# include<string>
# include<cmath>
# include<queue>
# include<stack>
# include<set>
# include<vector>
# include<cstdio>
# include<cstdlib>
# include<map>

# define deb(x) printf("# x=%d\n",x)
# define deb_d(x) printf("# x=%lf\n",x)
# define ccout(x) printf("%d\n",x)

typedef long long ll;

using namespace std;

const int maxsize=1e6+10;

string s,t;
int num1[500];
vector<int> pos;

int main(void){
	ios::sync_with_stdio(false);
    cin.tie(0);
	cin>>s>>t;
	if(s.length()<=t.length()){
		for(int i=0;i<s.length();i++){
			if(s[i]=='?'){
				s[i]=t[i];
			}
		}
		cout<<s<<endl;
		return 0;
	}
	memset(num1,0,sizeof(num1));
	for(int i=0;i<s.length();i++){
		if(s[i]=='?'){
			pos.push_back(i);
		}
		else
			num1[s[i]-'a']++;
	}
	while(!pos.empty()){
		for(int i=0;i<t.length();i++){
			if(num1[t[i]-'a']){
				num1[t[i]-'a']--;
			}
			else{
				s[pos.back()]=t[i];
				pos.pop_back();
				if(pos.empty())
					break;
			}
		}
	}
	cout<<s<<endl;
	return 0;
}


# include<iostream>
# include<algorithm>
# include<cstring>
# include<string>
# include<cmath>
# include<queue>
# include<stack>
# include<set>
# include<vector>
# include<cstdio>
# include<cstdlib>
# include<map>

# define deb(x) printf("# x=%d\n",x)
# define deb_d(x) printf("# x=%lf\n",x)
# define ccout(x) printf("%d\n",x)

typedef long long ll;

using namespace std;

const int maxsize=1e6+10;
double eps=1e-8;

struct node{
	double num1;
	double num2;
	double data;
	double loc;
	bool operator<(const node &a)const{
		if(data>a.data)
			return 1;
		else if(data==a.data&&num2>a.num2)
			return 1;
		return 0;
	}
	void Set(double a,double b,double c,double d);
};

priority_queue<node> q;

char s[maxsize],t[maxsize];
int cnt;
double num1[500],num2[500];
int pos[maxsize];

void node::Set(double a,double b,double c,double d){
	num1=a;
	num2=b;
	data=c;
	loc=d;
}

void handle(const int &xx){
	double Min=1e9+10,tmp;
	int x;
	for(int i=0;i<26;i++){
		if(num2[i]>0){
			tmp=(num1[i]*1.0)/num2[i];
			if(tmp<Min){
				Min=tmp;
				x=i;
			}
		}
	}
	s[pos[xx]]=x+'a';
	num1[x]++;
}

int main(void){
	node  now;
	scanf("%s %s",s,t);
	if(strlen(s)<=strlen(t)){
		for(int i=0;i<strlen(s);i++){
			if(s[i]=='?'){
				s[i]=t[i];
			}
		}
		puts(s);
		return 0;
	}
	cnt=0;
	memset(num1,0,sizeof(num1));
	memset(num2,0,sizeof(num2));
	for(int i=0;i<strlen(s);i++){
		if(s[i]=='?'){
			pos[cnt++]=i;
		}
		else
			num1[s[i]-'a']++;
	}
	for(int i=0;i<strlen(t);i++){
		num2[t[i]-'a']++;
	}
	for(int i=0;i<500;i++){
		if(num2[i]>0){
			now.Set(num1[i],num2[i],num1[i]/num2[i],i);
			q.push(now);
		}
	}
	double tmp1,tmp2;
	int xx;
	for(int i=0;i<cnt;i++){
		xx=q.top().loc;
		s[pos[i]]=xx+'a';
		tmp1=q.top().num1+1;
		tmp2=q.top().num2;
		now.Set(tmp1,tmp2,tmp1/tmp2,xx);
		q.pop();
		q.push(now);
	}
	puts(s);
	return 0;
}


# include<iostream>
# include<algorithm>
# include<cstring>
# include<string>
# include<cmath>
# include<queue>
# include<stack>
# include<set>
# include<vector>
# include<cstdio>
# include<cstdlib>
# include<map>

# define deb(x) printf("# x=%d\n",x)
# define deb_d(x) printf("# x=%lf\n",x)
# define ccout(x) printf("%d\n",x)

typedef long long ll;

using namespace std;

const int maxsize=1e6+10;

string s,t;
int num1[500];
vector<int> pos;

int main(void){
	ios::sync_with_stdio(false);
    cin.tie(0);
	cin>>s>>t;
	memset(num1,0,sizeof(num1));
	for(int i=0;i<s.length();i++){
		if(s[i]=='?'){
			pos.push_back(i);
		}
		else
			num1[s[i]-'a']++;
	}
	while(!pos.empty()){
		for(int i=0;i<t.length();i++){
			if(num1[t[i]-'a']){
				num1[t[i]-'a']--;
			}
			else{
				s[pos.back()]=t[i];
				pos.pop_back();
				if(pos.empty())
					break;
			}
		}
	}
	cout<<s<<endl;
	return 0;
}


# include<iostream>
# include<algorithm>
# include<cstring>
# include<string>
# include<cmath>
# include<queue>
# include<stack>
# include<set>
# include<vector>
# include<cstdio>
# include<cstdlib>
# include<map>

# define deb(x) printf("# x=%d\n",x)
# define deb_d(x) printf("# x=%lf\n",x)
# define ccout(x) printf("%d\n",x)

typedef long long ll;

using namespace std;

const int maxsize=1e6+10;
double eps=1e-8;

struct node{
	double num1;
	double num2;
	double data;
	double loc;
	bool operator<(const node &a)const{
		if(data>a.data)
			return 1;
		else if(data==a.data&&num2>a.num2)
			return 1;
		return 0;
	}
	void Set(double a,double b,double c,double d);
};

priority_queue<node> q;

char s[maxsize],t[maxsize];
int cnt;
double num1[300],num2[300];
int pos[maxsize];

void node::Set(double a,double b,double c,double d){
	num1=a;
	num2=b;
	data=c;
	loc=d;
}

void handle(const int &xx){
	double Min=1e9+10,tmp;
	int x;
	for(int i=0;i<26;i++){
		if(num2[i]>0){
			tmp=(num1[i]*1.0)/num2[i];
			if(tmp<Min){
				Min=tmp;
				x=i;
			}
		}
	}
	s[pos[xx]]=x+'a';
	num1[x]++;
}

int main(void){
	node  now;
	scanf("%s %s",s,t);
	if(strlen(s)<=strlen(t)){
		for(int i=0;i<strlen(s);i++){
			if(s[i]=='?'){
				s[i]=t[i];
			}
		}
		puts(s);
		return 0;
	}
	cnt=0;
	memset(num1,0,sizeof(num1));
	memset(num2,0,sizeof(num2));
	for(int i=0;i<strlen(s);i++){
		if(s[i]=='?'){
			pos[cnt++]=i;
		}
		else
			num1[s[i]-'a']++;
	}
	for(int i=0;i<strlen(t);i++){
		num2[t[i]-'a']++;
	}
	for(int i=0;i<300;i++){
		if(num2[i]>0){
			now.Set(num1[i],num2[i],num1[i]/num2[i],i);
			q.push(now);
		}
	}
	double tmp1,tmp2;
	int xx;
	for(int i=0;i<cnt;i++){
		xx=q.top().loc;
		s[pos[i]]=xx+'a';
		tmp1=q.top().num1+1;
		tmp2=q.top().num2;
		now.Set(tmp1,tmp2,tmp1/tmp2,xx);
		q.pop();
		q.push(now);
	}
	puts(s);
	return 0;
}


# include<iostream>
# include<algorithm>
# include<cstring>
# include<string>
# include<cmath>
# include<queue>
# include<stack>
# include<set>
# include<vector>
# include<cstdio>
# include<cstdlib>
# include<map>

# define deb(x) printf("# x=%d\n",x)
# define deb_d(x) printf("# x=%lf\n",x)
# define ccout(x) printf("%d\n",x)

typedef long long ll;

using namespace std;

const int maxsize=1e6+10;

struct node{
	int num1;
	int num2;
	double data;
	int loc;
	bool operator<(const node &a)const{
		return data>a.data;
	}
	void Set(int a,int b,double c,int d);
};

priority_queue<node> q;

char s[maxsize],t[maxsize];
int cnt;
int num1[30],num2[30];
int pos[maxsize];

void node::Set(int a,int b,double c,int d){
	num1=a;
	num2=b;
	data=c;
	loc=d;
}

void handle(const int &xx){
	double Min=1e9+10,tmp;
	int x;
	for(int i=0;i<26;i++){
		if(num2[i]>0){
			tmp=(num1[i]*1.0)/num2[i];
			if(tmp<Min){
				Min=tmp;
				x=i;
			}
		}
	}
	s[pos[xx]]=x+'a';
	num1[x]++;
}

int main(void){
	node  now;
	scanf("%s %s",s,t);
	if(strlen(s)<=strlen(t)){
		for(int i=0;i<strlen(s);i++){
			if(s[i]=='?'){
				putchar(t[i]);
			}
			else{
				putchar(s[i]);
			}
		}
		printf("\n");
		return 0;
	}
	cnt=0;
	memset(num1,0,sizeof(num1));
	memset(num2,0,sizeof(num2));
	for(int i=0;i<strlen(s);i++){
		if(s[i]=='?'){
			pos[cnt++]=i;
		}
		else
			num1[s[i]-'a']++;
	}
	for(int i=0;i<strlen(t);i++){
		num2[t[i]-'a']++;
	}
	for(int i=0;i<26;i++){
		if(num2[i]>0){
			now.Set(num1[i],num2[i],(num1[i]*1.0)/num2[i],i);
			q.push(now);
		}
	}
	int tmp1,tmp2;
	int xx;
	for(int i=0;i<cnt;i++){
		now=q.top();
		s[pos[i]]=q.top().loc+'a';
		xx=q.top().loc;
		tmp1=q.top().num1+1;
		tmp2=q.top().num2;
		now.Set(tmp1,tmp2,(tmp1*1.0)/tmp2,xx);
		q.pop();
		q.push(now);
	}
	printf("%s\n",s);
	return 0;
}


# include<iostream>
# include<algorithm>
# include<cstring>
# include<string>
# include<cmath>
# include<queue>
# include<stack>
# include<set>
# include<vector>
# include<cstdio>
# include<cstdlib>
# include<map>

# define deb(x) printf("# x=%d\n",x)
# define deb_d(x) printf("# x=%lf\n",x)
# define ccout(x) printf("%d\n",x)

typedef long long ll;

using namespace std;

const int maxsize=1e6+10;

struct node{
	int num1;
	int num2;
	double data;
	int loc;
	bool operator<(const node &a)const{
		if(data<a.data)
			return 1;
		else if(data==a.data&&loc<a.loc)
			return 1;
		return 0;
	}
	void Set(int a,int b,double c,int d);
};

set<node> S;

char s[maxsize],t[maxsize];
int cnt;
int num1[30],num2[30];
int pos[maxsize];

void node::Set(int a,int b,double c,int d){
	num1=a;
	num2=b;
	data=c;
	loc=d;
}

void handle(const int &xx){
	double Min=1e9+10,tmp;
	int x;
	for(int i=0;i<26;i++){
		if(num2[i]>0){
			tmp=(num1[i]*1.0)/num2[i];
			if(tmp<Min){
				Min=tmp;
				x=i;
			}
		}
	}
	s[pos[xx]]=x+'a';
	num1[x]++;
}

int main(void){
	node  now;
	gets(s);
	gets(t);
	if(strlen(s)<=strlen(t)){
		for(int i=0;i<strlen(s);i++){
			if(s[i]=='?'){
				putchar(t[i]);
			}
			else{
				putchar(s[i]);
			}
		}
		printf("\n");
		return 0;
	}
	cnt=0;
	memset(num1,0,sizeof(num1));
	memset(num2,0,sizeof(num2));
	for(int i=0;i<strlen(s);i++){
		if(s[i]=='?'){
			pos[cnt++]=i;
		}
		else
			num1[s[i]-'a']++;
	}
	for(int i=0;i<strlen(t);i++){
		num2[t[i]-'a']++;
	}
	for(int i=0;i<26;i++){
		if(num2[i]>0){
			now.Set(num1[i],num2[i],(num1[i]*1.0)/num2[i],i);
			S.insert(now);
		}
	}
	int tmp1,tmp2;
	int xx;
	for(int i=0;i<cnt;i++){
		s[pos[i]]=S.begin()->loc+'a';
		xx=S.begin()->loc;
		tmp1=S.begin()->num1+1;
		tmp2=S.begin()->num2;
		now.Set(tmp1,tmp2,(tmp1*1.0)/tmp2,xx);
		S.erase(S.begin());
		S.insert(now);
	}
	printf("%s\n",s);
	return 0;
}


# include<iostream>
# include<algorithm>
# include<cstring>
# include<string>
# include<cmath>
# include<queue>
# include<stack>
# include<set>
# include<vector>
# include<cstdio>
# include<cstdlib>
# include<map>

# define deb(x) printf("# x=%d\n",x)
# define deb_d(x) printf("# x=%lf\n",x)
# define ccout(x) printf("%d\n",x)

typedef long long ll;

using namespace std;

const int maxsize=1e6+10;

char s[maxsize],t[maxsize];
int cnt;
int num1[30],num2[30];
int pos[maxsize];

void handle(const int &i){
	double Min=1e9+10,tmp;
	int x;
	for(int i=0;i<26;i++){
		if(num2[i]>0){
			tmp=(num1[i]*1.0)/num2[i];
			if(tmp<Min){
				Min=tmp;
				x=i;
			}
		}
	}
	s[pos[i]]=x+'a';
	num1[x]++;
}

int main(void){
	gets(s);
	gets(t);
	if(strlen(s)<=strlen(t)){
		for(int i=0;i<strlen(s);i++){
			if(s[i]=='?'){
				putchar(t[i]);
			}
			else{
				putchar(s[i]);
			}
		}
		printf("\n");
		return 0;
	}
	cnt=0;
	memset(num1,0,sizeof(num1));
	memset(num2,0,sizeof(num2));
	for(int i=0;i<strlen(s);i++){
		if(s[i]=='?'){
			pos[cnt++]=i;
		}
		else
			num1[s[i]-'a']++;
	}
	for(int i=0;i<strlen(t);i++){
		num2[t[i]-'a']++;
	}
	for(int i=0;i<cnt;i++){
		handle(i);
	}
	printf("%s\n",s);
	return 0;
}


# include<iostream>
# include<algorithm>
# include<cstring>
# include<string>
# include<cmath>
# include<queue>
# include<stack>
# include<set>
# include<vector>
# include<cstdio>
# include<cstdlib>
# include<map>

# define deb(x) printf("# x=%d\n",x)
# define deb_d(x) printf("# x=%lf\n",x)
# define ccout(x) printf("%d\n",x)

typedef long long ll;

using namespace std;

const int maxsize=1e6+10;

char s[maxsize],t[maxsize];
int num1[500];
vector<int> pos;

int main(void){
	scanf("%s %s",s,t);
	if(strlen(s)<=strlen(t)){
		for(int i=0;i<strlen(s);i++){
			if(s[i]=='?'){
				s[i]=t[i];
			}
		}
		puts(s);
		return 0;
	}
	memset(num1,0,sizeof(num1));
	for(int i=0;i<strlen(s);i++){
		if(s[i]=='?'){
			pos.push_back(i);
		}
		else
			num1[s[i]-'a']++;
	}
	while(!pos.empty()){
		for(int i=0;i<strlen(t);i++){
			if(num1[t[i]-'a']){
				num1[t[i]-'a']--;
			}
			else{
				s[pos.back()]=t[i];
				pos.pop_back();
				if(pos.empty())
					break;
			}
		}
	}
	puts(s);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
char s[1000010] , t[1000010]; int ss , ts , ar[26] , br[26] , c , q , p , mark[26] ;
int bs (int l , int r)
{
	if( l == r)
	 	return l;
	if( r - l == 1)
	{
		int a = 0;
		for(int i = 0 ; i < 26 ; i++)
			a += br[i]*r - min(br[i]*r , ar[i]);
		if(a <= q)
			return r;
		return l;
	}
	int mid = (r + l) / 2;
	int b = 0;
	for(int i = 0 ; i < 26 ; i++)
		b += br[i]*mid - min(br[i]*mid , ar[i]);
	if(b <= q)
		return bs(mid , r);
	else
		return bs(l , mid-1);

}
int main()
{
	scanf("%s%s" , s , t);
	ss = strlen(s);
	ts = strlen(t);
	for(int i = 0 ; i < ss ; i++)
	{
		ar[s[i]-'a']++;
		if(s[i] == '?')
			q++;
	}
	for(int i = 0 ; i < ts ; i++)
		br[t[i]-'a']++;
	c = bs(0 , 1e6);
	p = 0;
	for(int i = 0 ; i < ss ; i++)
	{
		if(s[i] == '?')
		{
			for(int j = 0 ; j < 26 ; j++)
				if(ar[j] < c * br[j])
				{
					s[i] = 'a' + j;
					ar[j]++;
					break;
				}
		}
	}
	for(int i = 0 ; i < ss ; i++)
		if(s[i] == '?')
			s[i] = 'z';
	printf("%s\n" , s);
}


#include<bits/stdc++.h>
using namespace std;
char s[1000010] , t[1000010]; int ss , ts , ar[26] , br[26] , c , q , p , mark[26] ;
int bs (int l , int r)
{
	if( l == r)
	 	return l;
	if( r - l == 1)
	{
		int a = 0;
		for(int i = 0 ; i < 26 ; i++)
			a += br[i]*r - min(br[i]*r , ar[i]);
		if(a <= q)
			return r;
		return l;
	}
	int mid = (r + l) / 2;
	int b = 0;
	for(int i = 0 ; i < 26 ; i++)
		b += br[i]*mid - min(br[i]*mid , ar[i]);
	if(b <= q)
		return bs(mid , r);
	else
		return bs(l , mid-1);

}
int main()
{
	scanf("%s%s" , s , t);
	ss = strlen(s);
	ts = strlen(t);
	for(int i = 0 ; i < ss ; i++)
	{
		ar[s[i]-'a']++;
		if(s[i] == '?')
			q++;
	}

	for(int i = 0 ; i < ts ; i++)
		br[t[i]-'a']++;

	c = bs(0 , 1e6);
	p = 0;
	for(int i = 0 ; i < ss ; i++)
	{
		if(s[i] == '?')
		{
			if(ar[t[p] - 'a'] < br[t[p] - 'a']*c)
			{
				s[i] = t[p];
				ar[t[p] - 'a']++;
			}
			else
			{

				while(p < ss)
				{

					if(mark[t[p]-'a'])
						p++;
					else if(!mark[t[p]-'a'] && ar[t[p]-'a'] >= br[t[p]-'a']*c)
					{
						mark[t[p]-'a'] = 1;
						p++;
					}
					else
					{
						s[i] = t[p];
						ar[t[p]-'a']++;
						break;
					}
				}
				if(p == ss)
				{
					for(int j = i ; j < ss ; j++)
						if(s[j] == '?')
							s[j] = 'b';
					printf("%s\n" , s);
					return 0;
				}
			}
		}
	}
	printf("%s\n" , s);
}


#include<bits/stdc++.h>
using namespace std;
char s[1000010] , t[1000010]; int ss , ts , ar[26] , br[26] , c , q , p , mark[26] ;
int bs (int l , int r)
{
	if( l == r)
	 	return l;
	if( r - l == 1)
	{
		int a = 0;
		for(int i = 0 ; i < 26 ; i++)
			a += br[i]*r - min(br[i]*r , ar[i]);
		if(a <= q)
			return r;
		return l;
	}
	int mid = (r + l) / 2;
	int b = 0;
	for(int i = 0 ; i < 26 ; i++)
		b += br[i]*mid - min(br[i]*mid , ar[i]);
	if(b <= q)
		return bs(mid , r);
	else
		return bs(l , mid-1);

}
int main()
{
	scanf("%s%s" , s , t);
	ss = strlen(s);
	ts = strlen(t);
	for(int i = 0 ; i < ss ; i++)
	{

		if(s[i] == '?')
			q++;
		else
			ar[s[i]-'a']++;
	}
	for(int i = 0 ; i < ts ; i++)
		br[t[i]-'a']++;
	c = bs(0 , ss/ts);
	p = 0;
	for(int i = 0 ; i < ss ; i++)
	{
		if(s[i] == '?')
		{
			for(int j = 0 ; j < 26 ; j++)
				if(ar[j] < c * br[j])
				{
					s[i] = 'a' + j;
					ar[j]++;
					break;
				}
		}
	}
	for(int i = 0 ; i < ss ; i++)
		if(s[i] == '?')
			s[i] = 'z';
	printf("%s\n" , s);
}


#include<bits/stdc++.h>
using namespace std;
char s[1000010] , t[1000010]; int ss , ts , ar[26] , br[26] , c , q , p , mark[26] ;
int bs (int l , int r)
{
	if( l == r)
	 	return l;
	if( r - l == 1)
	{
		int a = 0;
		for(int i = 0 ; i < 26 ; i++)
			a += br[i]*r - min(br[i]*r , ar[i]);
		if(a <= q)
			return r;
		return l;
	}
	int mid = (r + l) / 2;
	int b = 0;
	for(int i = 0 ; i < 26 ; i++)
		b += br[i]*mid - min(br[i]*mid , ar[i]);
	if(b <= q)
		return bs(mid , r);
	else
		return bs(l , mid-1);

}
int main()
{
	scanf("%s%s" , s , t);
	ss = strlen(s);
	ts = strlen(t);
	for(int i = 0 ; i < ss ; i++)
	{
		ar[s[i]-'a']++;
		if(s[i] == '?')
			q++;
	}
	for(int i = 0 ; i < ts ; i++)
		br[t[i]-'a']++;
	c = bs(0 , 1e6);
	p = 0;
	if(s[0] == 'z' && s[1] == 'j' && s[1] == 'q' && s[2] == 'q')
		cout << c << endl;
	for(int i = 0 ; i < ss ; i++)
	{
		if(s[i] == '?')
		{
			for(int j = 0 ; j < 26 ; j++)
				if(ar[j] < c * br[j])
				{
					s[i] = 'a' + j;
					ar[j]++;
					break;
				}
		}
	}
	for(int i = 0 ; i < ss ; i++)
		if(s[i] == '?')
			s[i] = 'z';
	printf("%s\n" , s);
}


#include<bits/stdc++.h>
using namespace std;
char s[1000010] , t[1000010]; int ss , ts , ar[26] , br[26] , c , q , p , mark[26] ;
int bs (int l , int r)
{
	if( l == r)
	 	return l;
	if( r - l == 1)
	{
		int a = 0;
		for(int i = 0 ; i < 26 ; i++)
			a += br[i]*r - min(br[i]*r , ar[i]);
		if(a <= q)
			return r;
		return l;
	}
	int mid = (r + l) / 2;
	int b = 0;
	for(int i = 0 ; i < 26 ; i++)
		b += br[i]*mid - min(br[i]*mid , ar[i]);
	if(b <= q)
		return bs(mid , r);
	else
		return bs(l , mid-1);

}
int main()
{
	scanf("%s%s" , s , t);
	ss = strlen(s);
	ts = strlen(t);
	for(int i = 0 ; i < ss ; i++)
	{
		ar[s[i]-'a']++;
		if(s[i] == '?')
			q++;
	}

	for(int i = 0 ; i < ts ; i++)
		br[t[i]-'a']++;

	c = bs(0 , 1e6);
	for(int i = 0 ; i < ss ; i++)
	{
		if(s[i] == '?')
		{
			if(ar[t[p] - 'a'] < br[t[p] - 'a']*c)
			{
				s[i] = t[p];
				ar[t[p] - 'a']++;
			}
			else
			{

				while(1)
				{
					if(p == ss)
					{
						s[i] = 'z';
						break;
					}
					else if(mark[t[p]-'a'])
						p++;
					else if(!mark[t[p]-'a'] && ar[t[p]-'a'] >= br[t[p]-'a'])
					{
						mark[t[p]-'a'] = 1;
						p++;
					}
					else
					{
						s[i] = t[p];
						ar[t[p]-'a']++;
						break;
					}
				}

			}
		}
	}
	printf("%s\n" , s);
}


#include<bits/stdc++.h>
using namespace std;
char s[1000010] , t[1000010]; int ss , ts , ar[26] , br[26] , c , q , p , mark[26] ;
int bs (int l , int r)
{
	if( l == r)
	 	return l;
	if( r - l == 1)
	{
		int a = 0;
		for(int i = 0 ; i < 26 ; i++)
			a += br[i]*r - min(br[i]*r , ar[i]);
		if(a <= q)
			return r;
		return l;
	}
	int mid = (r + l) / 2;
	int b = 0;
	for(int i = 0 ; i < 26 ; i++)
		b += br[i]*mid - min(br[i]*mid , ar[i]);
	if(b <= q)
		return bs(mid , r);
	else
		return bs(l , mid-1);

}
int main()
{
	scanf("%s%s" , s , t);
	ss = strlen(s);
	ts = strlen(t);
	for(int i = 0 ; i < ss ; i++)
	{
		ar[s[i]-'a']++;
		if(s[i] == '?')
			q++;
	}
	for(int i = 0 ; i < ts ; i++)
		br[t[i]-'a']++;
	c = bs(0 , 1e6);
	p = 0;
	if(s[0] == 'z' && s[1] == 'j' && s[2] == 'q' && s[3] == 'q')
		cout << c << endl;
	for(int i = 0 ; i < ss ; i++)
	{
		if(s[i] == '?')
		{
			for(int j = 0 ; j < 26 ; j++)
				if(ar[j] < c * br[j])
				{
					s[i] = 'a' + j;
					ar[j]++;
					break;
				}
		}
	}
	for(int i = 0 ; i < ss ; i++)
		if(s[i] == '?')
			s[i] = 'z';
	printf("%s\n" , s);
}


#include<bits/stdc++.h>
using namespace std;
char s[1000010] , t[1000010]; int ss , ts , ar[26] , br[26] , c , q , p ;
int bs (int l , int r)
{
	if( l == r)
	 	return l;
	if( r - l == 1)
	{
		int a = 0;
		for(int i = 0 ; i < 26 ; i++)
			a += br[i]*r - min(br[i]*r , ar[i]);
		if(a <= q)
			return r;
		return l;
	}
	int mid = (r + l) / 2;
	int b = 0;
	for(int i = 0 ; i < 26 ; i++)
		b += br[i]*mid - min(br[i]*mid , ar[i]);
	if(b <= q)
		return bs(mid , r);
	else
		return bs(l , mid-1);

}
int main()
{
	scanf("%s%s" , s , t);
	ss = strlen(s);
	ts = strlen(t);
	for(int i = 0 ; i < ss ; i++)
	{
		ar[s[i]-'a']++;
		if(s[i] == '?')
			q++;
	}

	for(int i = 0 ; i < ts ; i++)
		br[t[i]-'a']++;

	c = bs(0 , 1e6);
	for(int i = 0 ; i < ss ; i++)
	{
		if(s[i] == '?')
		{
			if(ar[p] < br[p]*c)
			{
				s[i] = 'a' + p;
				ar[p]++;
				if(ar[p] >= br[p]*c)
					p++;
				if(p == 26)
					p--;
			}
			else
			{
				while(!br[p] && p < 26  || (br[p] && br[p]*c <= ar[p]))
					p++;
				p %= 26;
				s[i] = 'a' + p;
			}
		}
	}
	printf("%s\n" , s);
}


#include<bits/stdc++.h>
using namespace std;
char s[1000010] , t[1000010]; int ss , ts , ar[26] , br[26] , c , q , p , mark[26] ;
int bs (int l , int r)
{
	if( l == r)
	 	return l;
	if( r - l == 1)
	{
		int a = 0;
		for(int i = 0 ; i < 26 ; i++)
			a += br[i]*r - min(br[i]*r , ar[i]);
		if(a <= q)
			return r;
		return l;
	}
	int mid = (r + l) / 2;
	int b = 0;
	for(int i = 0 ; i < 26 ; i++)
		b += br[i]*mid - min(br[i]*mid , ar[i]);
	if(b <= q)
		return bs(mid , r);
	else
		return bs(l , mid-1);

}
int main()
{
	scanf("%s%s" , s , t);
	ss = strlen(s);
	ts = strlen(t);
	for(int i = 0 ; i < ss ; i++)
	{
		ar[s[i]-'a']++;
		if(s[i] == '?')
			q++;
	}
	for(int i = 0 ; i < ts ; i++)
		br[t[i]-'a']++;
	c = bs(0 , 1e6);
	p = 0;
	if(s[0] == 'f' && s[1] == 'z' && s[2] == 'q')
		cout << c << endl;
	for(int i = 0 ; i < ss ; i++)
	{
		if(s[i] == '?')
		{
			for(int j = 0 ; j < 26 ; j++)
				if(ar[j] < c * br[j])
				{
					s[i] = 'a' + j;
					ar[j]++;
					break;
				}
		}
	}
	for(int i = 0 ; i < ss ; i++)
		if(s[i] == '?')
			s[i] = 'z';
	printf("%s\n" , s);
}


#include<bits/stdc++.h>
using namespace std;
char s[1000010] , t[1000010]; int ss , ts , ar[26] , br[26] , c , q , p , mark[26] ;
int bs (int l , int r)
{
	if( l == r)
	 	return l;
	if( r - l == 1)
	{
		int a = 0;
		for(int i = 0 ; i < 26 ; i++)
			a += br[i]*r - min(br[i]*r , ar[i]);
		if(a <= q)
			return r;
		return l;
	}
	int mid = (r + l) / 2;
	int b = 0;
	for(int i = 0 ; i < 26 ; i++)
		b += br[i]*mid - min(br[i]*mid , ar[i]);
	if(b <= q)
		return bs(mid , r);
	else
		return bs(l , mid-1);

}
int main()
{
	scanf("%s%s" , s , t);
	ss = strlen(s);
	ts = strlen(t);
	for(int i = 0 ; i < ss ; i++)
	{
		ar[s[i]-'a']++;
		if(s[i] == '?')
			q++;
	}
	for(int i = 0 ; i < ts ; i++)
		br[t[i]-'a']++;
	c = bs(0 , 1e6);
	p = 0;
	if(s[0] == 'f' && s[1] == 'z' && s[2] == 'j')
		cout << c << endl;
	for(int i = 0 ; i < ss ; i++)
	{
		if(s[i] == '?')
		{
			for(int j = 0 ; j < 26 ; j++)
				if(ar[j] < c * br[j])
				{
					s[i] = 'a' + j;
					ar[j]++;
					break;
				}
		}
	}
	for(int i = 0 ; i < ss ; i++)
		if(s[i] == '?')
			s[i] = 'z';
	printf("%s\n" , s);
}


#include<bits/stdc++.h>
using namespace std;
char s[1000010] , t[1000010]; int ss , ts , ar[26] , br[26] , c , q , p , mark[26] ;
int bs (int l , int r)
{
	if( l == r)
	 	return l;
	if( r - l == 1)
	{
		int a = 0;
		for(int i = 0 ; i < 26 ; i++)
			a += br[i]*r - min(br[i]*r , ar[i]);
		if(a <= q)
			return r;
		return l;
	}
	int mid = (r + l) / 2;
	int b = 0;
	for(int i = 0 ; i < 26 ; i++)
		b += br[i]*mid - min(br[i]*mid , ar[i]);
	if(b <= q)
		return bs(mid , r);
	else
		return bs(l , mid-1);

}
int main()
{
	scanf("%s%s" , s , t);
	ss = strlen(s);
	ts = strlen(t);
	for(int i = 0 ; i < ss ; i++)
	{

		if(s[i] == '?')
			q++;
		else
			ar[s[i]-'a']++;
	}
	for(int i = 0 ; i < ts ; i++)
		br[t[i]-'a']++;
	c = bs(0 , 1e6);
	p = 0;
	for(int i = 0 ; i < ss ; i++)
	{
		if(s[i] == '?')
		{
			for(int j = 0 ; j < 26 ; j++)
				if(ar[j] < c * br[j])
				{
					s[i] = 'a' + j;
					ar[j]++;
					break;
				}
		}
	}
	for(int i = 0 ; i < ss ; i++)
		if(s[i] == '?')
			s[i] = 'z';
	printf("%s\n" , s);
}


#include<bits/stdc++.h>
using namespace std;
char s[1000010] , t[1000010]; int ss , ts , ar[26] , br[26] , c , q , p , mark[26] ;
int bs (int l , int r)
{
	if( l == r)
	 	return l;
	if( r - l == 1)
	{
		int a = 0;
		for(int i = 0 ; i < 26 ; i++)
			a += br[i]*r - min(br[i]*r , ar[i]);
		if(a <= q)
			return r;
		return l;
	}
	int mid = (r + l) / 2;
	int b = 0;
	for(int i = 0 ; i < 26 ; i++)
		b += br[i]*mid - min(br[i]*mid , ar[i]);
	if(b <= q)
		return bs(mid , r);
	else
		return bs(l , mid-1);

}
int main()
{
	scanf("%s%s" , s , t);
	ss = strlen(s);
	ts = strlen(t);
	for(int i = 0 ; i < ss ; i++)
	{
		ar[s[i]-'a']++;
		if(s[i] == '?')
			q++;
	}

	for(int i = 0 ; i < ts ; i++)
		br[t[i]-'a']++;

	c = bs(0 , 1e6);
	p = 0;
	for(int i = 0 ; i < ss ; i++)
	{
		if(s[i] == '?')
		{
			if(ar[t[p] - 'a'] < br[t[p] - 'a']*c)
			{
				s[i] = t[p];
				ar[t[p] - 'a']++;
			}
			else
			{

				while(p < ss)
				{

					if(mark[t[p]-'a'])
						p++;
					else if(!mark[t[p]-'a'] && ar[t[p]-'a'] >= br[t[p]-'a']*c)
					{
						mark[t[p]-'a'] = 1;
						p++;
					}
					else
					{
						s[i] = t[p];
						ar[t[p]-'a']++;
						break;
					}
				}
				if(p == ss)
				{
					for(int j = i ; j < ss ; j++)
						if(s[j] == '?')
							s[j] = 'z' , i = ss+10;
				}
			}
		}
	}
	printf("%s\n" , s);
}


#include<bits/stdc++.h>
using namespace std;
char s[1000010] , t[1000010]; int ss , ts , ar[26] , br[26] , c , q , p , mark[26] ;
int bs (int l , int r)
{
	if( l == r)
	 	return l;
	if( r - l == 1)
	{
		int a = 0;
		for(int i = 0 ; i < 26 ; i++)
			a += br[i]*r - min(br[i]*r , ar[i]);
		if(a <= q)
			return r;
		return l;
	}
	int mid = (r + l) / 2;
	int b = 0;
	for(int i = 0 ; i < 26 ; i++)
		b += br[i]*mid - min(br[i]*mid , ar[i]);
	if(b <= q)
		return bs(mid , r);
	else
		return bs(l , mid-1);

}
int main()
{
	scanf("%s%s" , s , t);
	ss = strlen(s);
	ts = strlen(t);
	for(int i = 0 ; i < ss ; i++)
	{
		ar[s[i]-'a']++;
		if(s[i] == '?')
			q++;
	}

	for(int i = 0 ; i < ts ; i++)
		br[t[i]-'a']++;

	c = bs(0 , 1e6);
	for(int i = 0 ; i < ss ; i++)
	{
		if(s[i] == '?')
		{
			if(ar[t[p] - 'a'] < br[t[p] - 'a']*c)
			{
				s[i] = t[p];
				ar[t[p] - 'a']++;
			}
			else
			{

				while(p < ss)
				{

					if(mark[t[p]-'a'])
						p++;
					else if(!mark[t[p]-'a'] && ar[t[p]-'a'] >= br[t[p]-'a'])
					{
						mark[t[p]-'a'] = 1;
						p++;
					}
					else
					{
						s[i] = t[p];
						ar[t[p]-'a']++;
						break;
					}
				}
				if(p == ss)
					s[i] = 'z';
			}
		}
	}
	printf("%s\n" , s);
}


#include<bits/stdc++.h>
using namespace std;
char s[1000010] , t[1000010]; int ss , ts , ar[26] , br[26] , c , q , p , mark[26] ;
int bs (int l , int r)
{
	if( l == r)
	 	return l;
	if( r - l == 1)
	{
		int a = 0;
		for(int i = 0 ; i < 26 ; i++)
			a += br[i]*r - min(br[i]*r , ar[i]);
		if(a <= q)
			return r;
		return l;
	}
	int mid = (r + l) / 2;
	int b = 0;
	for(int i = 0 ; i < 26 ; i++)
		b += br[i]*mid - min(br[i]*mid , ar[i]);
	if(b <= q)
		return bs(mid , r);
	else
		return bs(l , mid-1);

}
int main()
{
	scanf("%s%s" , s , t);
	ss = strlen(s);
	ts = strlen(t);
	for(int i = 0 ; i < ss ; i++)
	{
		ar[s[i]-'a']++;
		if(s[i] == '?')
			q++;
	}

	for(int i = 0 ; i < ts ; i++)
		br[t[i]-'a']++;

	c = bs(0 , 1e6);
	p = 0;
	for(int i = 0 ; i < ss ; i++)
	{
		if(s[i] == '?')
		{
			if(ar[t[p] - 'a'] < br[t[p] - 'a']*c)
			{
				s[i] = t[p];
				ar[t[p] - 'a']++;
			}
			else
			{

				while(p < ts)
				{

					if(mark[t[p]-'a'])
						p++;
					else if(!mark[t[p]-'a'] && ar[t[p]-'a'] >= br[t[p]-'a']*c)
					{
						mark[t[p]-'a'] = 1;
						p++;
					}
					else
					{
						s[i] = t[p];
						ar[t[p]-'a']++;
						break;
					}
				}
				if(p == ts)
				{
					for(int j = i ; j < ss ; j++)
						if(s[j] == '?')
							s[j] = 'b';
					printf("%s\n" , s);
					return 0;
				}
			}
		}
	}
	printf("%s\n" , s);
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
char s1[1000010],s2[1000010];
int a[27],b[27];
int check()
{
    while(1)
    {
        for(int i=0; i<26; i++)
            if(a[i]<b[i])return i;
        for(int i=0; i<26; i++)
            a[i]-=b[i];
    }
}
int main()
{
    scanf("%s%s",s1,s2);
    int len2=strlen(s2);
    for(int i=0; i<len2; i++)
        b[s2[i]-'a']++;
    int len1=strlen(s1);
    for(int i=0; i<len1; i++)
        if(s1[i]<='z'&&s1[i]>='a')
            a[s1[i]-'a']++;
    for(int i=0;i<len1;i++)
    {
        if(s1[i]=='?')
        {
            s1[i]=check()+'a';
            a[s1[i]-'a']++;
        }

    }
    printf("%s\n",s1);
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#define lo(i, n, m) for(int i = n; i < m; i++)

using namespace std;

const int LIM = 30;
int scnt[LIM],  tcnt[LIM];
bool vis[LIM];

struct Node {
    char ch;
    int num;
    Node(char c = 0, int n = 0) : ch(c), num(n) {}
    bool operator < (const Node &n) const {
        return num < n.num;
    }
};
vector<Node> tofill;

int main(void) {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    string s, t;
    cin >> s >> t;
    int markcnt = 0;
    lo(i, 0, s.size()) {
        if (s[i] == '?') markcnt++;
        else scnt[s[i] - 'a']++;
    }
    int cnt = 0;
    lo(i, 0, t.size()) {
        tcnt[t[i] - 'a']++;
        if (!vis[t[i] - 'a']) {
            cnt += scnt[t[i] - 'a'];
            vis[t[i] - 'a'] = true;
        }
    }
    lo(i, 0, 26) {
        if (!vis[i]) continue;
        int tt = tcnt[i];
        int ts = scnt[i];
        int tmp = ts % tt;
        ts /= tt;
        for (int j = 0; j < tt; j++) {
            if (tmp > 0) {
                tmp--;
                tofill.push_back(Node(i + 'a', ts + 1));
            } else {
                tofill.push_back(Node(i + 'a', ts));
            }
        }
    }
    // cout << "size: " << tofill.size() << endl;
    sort(tofill.begin(), tofill.end());
    int j = 0;
    lo(i, 0, s.size()) {
        if (s[i] == '?') {
            if (j >= tofill.size()) j = 0;
            cout << tofill[j].ch;
            tofill[j].num++;
            if (j == tofill.size() - 1 || tofill[j].num > tofill[j + 1].num)
                j++;
        } else {
            cout << s[i];
        }
    }
    cout << '\n';
    return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#define lo(i, n, m) for(int i = n; i < m; i++)

using namespace std;

typedef long long LL;

const int LIM = 30;
int scnt[LIM], tcnt[LIM];

inline int mini(int a, int b) {return a < b ? a : b;}

int main(void) {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    string s, t;
    cin >> s >> t;
    int markcnt = 0;
    lo(i, 0, s.size())
        if (s[i] == '?') markcnt++;
        else scnt[s[i] - 'a']++;
    lo(i, 0, t.size()) tcnt[t[i] - 'a']++;
    int l = 0, r = s.size();
    while (l < r) {
        int mid = l + ((r - l) >> 1);
        LL tmp = 0;
        lo(i, 0, 26) tmp += tcnt[i] * mid - mini(tcnt[i] * mid, scnt[i]);
        if (markcnt < tmp) r = mid;
        else l = mid + 1;
    }
    l--;
    int j = 0;
    lo(i, 0, s.size())
        if (s[i] == '?') {
            while (j < 25 && scnt[j] >= tcnt[j] * l) j++;
            cout << (char)(j + 'a');
            scnt[j]++;
        } else {
            cout << s[i];
        }
    cout << '\n';
    return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#define lo(i, n, m) for(int i = n; i < m; i++)

using namespace std;

typedef long long LL;

const int LIM = 30;
int scnt[LIM], tcnt[LIM];

inline LL mini(LL a, LL b) {return a < b ? a : b;}

int main(void) {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    string s, t;
    cin >> s >> t;
    int markcnt = 0;
    lo(i, 0, s.size())
        if (s[i] == '?') markcnt++;
        else scnt[s[i] - 'a']++;
    if (!markcnt) {
        cout << s << '\n';
        return 0;
    }
    lo(i, 0, t.size()) tcnt[t[i] - 'a']++;
    int l = 0, r = s.size();
    while (l < r) {
        int mid = l + ((r - l) >> 1);
        LL tmp = 0;
        lo(i, 0, 26) tmp += 1ll * tcnt[i] * mid - mini(1ll * tcnt[i] * mid, scnt[i]);
        if (markcnt < tmp) r = mid;
        else l = mid + 1;
    }
    l--;
    int j = 0;
    lo(i, 0, s.size())
        if (s[i] == '?') {
            while (j < 25 && scnt[j] >= tcnt[j] * l) j++;
            cout << (char)(j + 'a');
            scnt[j]++;
        } else {
            cout << s[i];
        }
    cout << '\n';
    return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#define lo(i, n, m) for(int i = n; i < m; i++)

using namespace std;

const int LIM = 30;
int scnt[LIM],  tcnt[LIM];

inline int mini(int a, int b) {return a < b ? a : b;}

int main(void) {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    string s, t;
    cin >> s >> t;
    int markcnt = 0;
    lo(i, 0, s.size())
        if (s[i] == '?') markcnt++;
        else scnt[s[i] - 'a']++;
    lo(i, 0, t.size()) tcnt[t[i] - 'a']++;
    int l = 0, r = s.size() + 1;
    while (l < r) {
        int mid = l + (r - l) >> 1;
        int tmp = 0;
        lo(i, 0, 26) tmp += tcnt[i] * mid - mini(tcnt[i] * mid, scnt[i]);
        if (tmp < markcnt) l = mid + 1;
        else r = mid;
    }
    int j = 0;
    lo(i, 0, s.size())
        if (s[i] == '?') {
            while (j < 25 && scnt[j] >= tcnt[j] * l) j++;
            cout << (char)(j + 'a');
        } else {
            cout << s[i];
        }
    cout << '\n';
    return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#define lo(i, n, m) for(int i = n; i < m; i++)

using namespace std;

const int LIM = 30;
int scnt[LIM],  tcnt[LIM];
bool vis[LIM];

struct Node {
    char ch;
    int num;
    Node(char c = 0, int n = 0) : ch(c), num(n) {}
    bool operator < (const Node &n) const {
        return num < n.num;
    }
};
vector<Node> tofill;

int main(void) {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    string s, t;
    cin >> s >> t;
    int markcnt = 0;
    lo(i, 0, s.size()) {
        if (s[i] == '?') markcnt++;
        else scnt[s[i] - 'a']++;
    }
    int cnt = 0;
    lo(i, 0, t.size()) {
        tcnt[t[i] - 'a']++;
        if (!vis[t[i] - 'a']) {
            cnt += scnt[t[i] - 'a'];
            vis[t[i] - 'a'] = true;
        }
    }
    lo(i, 0, 26) {
        if (!vis[i]) continue;
        int tt = tcnt[i];
        int ts = scnt[i];
        int tmp = ts % tt;
        ts /= tt;
        for (int j = 0; j < tt; j++) {
            if (tmp > 0) {
                tmp--;
                tofill.push_back(Node(i + 'a', ts + 1));
            } else {
                tofill.push_back(Node(i + 'a', ts));
            }
        }
    }
    // cout << "size: " << tofill.size() << endl;
    sort(tofill.begin(), tofill.end());
    int j = 0;
    lo(i, 0, s.size()) {
        if (s[i] == '?') {
            if (j >= tofill.size()) j = 0;
            cout << tofill[j].ch;
            tofill[j].num++;
            if (j == tofill.size() - 1 || tofill[j].num >= tofill[j + 1].num)
                j++;
        } else {
            cout << s[i];
        }
    }
    cout << '\n';
    return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#define lo(i, n, m) for(int i = n; i < m; i++)

using namespace std;

typedef long long LL;

const int LIM = 30;
int scnt[LIM], tcnt[LIM];

inline LL mini(LL a, LL b) {return a < b ? a : b;}

int main(void) {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    string s, t;
    cin >> s >> t;
    int markcnt = 0;
    lo(i, 0, s.size())
        if (s[i] == '?') markcnt++;
        else scnt[s[i] - 'a']++;
    if (!markcnt) {
        cout << s << '\n';
        return 0;
    }
    lo(i, 0, t.size()) tcnt[t[i] - 'a']++;
    int l = 0, r = s.size() + 1;
    while (l < r) {
        int mid = l + ((r - l) >> 1);
        LL tmp = 0;
        lo(i, 0, 26) tmp += 1ll * tcnt[i] * mid - mini(1ll * tcnt[i] * mid, scnt[i]);
        if (markcnt < tmp) r = mid;
        else l = mid + 1;
    }
    l--;
    int j = 0;
    lo(i, 0, s.size())
        if (s[i] == '?') {
            while (j < 25 && scnt[j] >= tcnt[j] * l) j++;
            cout << (char)(j + 'a');
            scnt[j]++;
        } else {
            cout << s[i];
        }
    cout << '\n';
    return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#define lo(i, n, m) for(int i = n; i < m; i++)

using namespace std;

typedef long long LL;

const int LIM = 30;
int scnt[LIM], tcnt[LIM];

inline LL mini(LL a, LL b) {return a < b ? a : b;}

int main(void) {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    string s, t;
    cin >> s >> t;
    int markcnt = 0;
    lo(i, 0, s.size())
        if (s[i] == '?') markcnt++;
        else scnt[s[i] - 'a']++;
    lo(i, 0, t.size()) tcnt[t[i] - 'a']++;
    int l = 0, r = s.size();
    while (l < r) {
        int mid = l + ((r - l) >> 1);
        LL tmp = 0;
        lo(i, 0, 26) tmp += 1ll * tcnt[i] * mid - mini(1ll * tcnt[i] * mid, scnt[i]);
        if (markcnt < tmp) r = mid;
        else l = mid + 1;
    }
    l--;
    int j = 0;
    lo(i, 0, s.size())
        if (s[i] == '?') {
            while (j < 25 && scnt[j] >= tcnt[j] * l) j++;
            cout << (char)(j + 'a');
            scnt[j]++;
        } else {
            cout << s[i];
        }
    cout << '\n';
    return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#define lo(i, n, m) for(int i = n; i < m; i++)

using namespace std;

const int LIM = 30;
int scnt[LIM],  tcnt[LIM];

inline int mini(int a, int b) {return a < b ? a : b;}

int main(void) {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    string s, t;
    cin >> s >> t;
    int markcnt = 0;
    lo(i, 0, s.size())
        if (s[i] == '?') markcnt++;
        else scnt[s[i] - 'a']++;
    lo(i, 0, t.size()) tcnt[t[i] - 'a']++;
    int l = 0, r = s.size() + 1;
    while (l < r) {
        int mid = l + (r - l) >> 1;
        int tmp = 0;
        lo(i, 0, 26) tmp += tcnt[i] * mid - mini(tcnt[i] * mid, scnt[i]);
        if (tmp < markcnt) l = mid + 1;
        else r = mid;
    }
    int j = 0;
    lo(i, 0, s.size())
        if (s[i] == '?') {
            while (j < 25 && scnt[j] >= tcnt[j] * l) j++;
            cout << (char)(j + 'a');
            scnt[j]++;
        } else {
            cout << s[i];
        }
    cout << '\n';
    return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#define lo(i, n, m) for(int i = n; i < m; i++)

using namespace std;

const int LIM = 30;
int scnt[LIM],  tcnt[LIM];

inline int mini(int a, int b) {return a < b ? a : b;}

int main(void) {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    string s, t;
    cin >> s >> t;
    int markcnt = 0;
    lo(i, 0, s.size())
        if (s[i] == '?') markcnt++;
        else scnt[s[i] - 'a']++;
    lo(i, 0, t.size()) tcnt[t[i] - 'a']++;
    int l = 0, r = s.size();
    while (l < r) {
        int mid = l + ((r - l) >> 1);
        int tmp = 0;
        lo(i, 0, 26) tmp += tcnt[i] * mid - mini(tcnt[i] * mid, scnt[i]);
        if (tmp < markcnt) l = mid + 1;
        else r = mid;
    }
    int j = 0;
    lo(i, 0, s.size())
        if (s[i] == '?') {
            while (j < 25 && scnt[j] >= tcnt[j] * l) j++;
            cout << (char)(j + 'a');
            scnt[j]++;
        } else {
            cout << s[i];
        }
    cout << '\n';
    return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#define lo(i, n, m) for(int i = n; i < m; i++)

using namespace std;

typedef long long LL;

const int LIM = 30;
int scnt[LIM], tcnt[LIM];

inline LL mini(LL a, LL b) {return a < b ? a : b;}

int main(void) {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    string s, t;
    cin >> s >> t;
    int markcnt = 0;
    lo(i, 0, s.size())
        if (s[i] == '?') markcnt++;
        else scnt[s[i] - 'a']++;
    if (!markcnt) {
        cout << s << '\n';
        return 0;
    }
    lo(i, 0, t.size()) tcnt[t[i] - 'a']++;
    int l = 0, r = s.size() + 1;
    while (l < r) {
        int mid = l + ((r - l) >> 1);
        LL tmp = 0;
        lo(i, 0, 26) tmp += 1ll * tcnt[i] * mid - mini(1ll * tcnt[i] * mid, scnt[i]);
        if (markcnt < tmp) r = mid;
        else l = mid + 1;
    }
    l--;
    cout << l << endl;
    int j = 0;
    lo(i, 0, s.size())
        if (s[i] == '?') {
            while (j < 25 && scnt[j] >= tcnt[j] * l) j++;
            cout << (char)(j + 'a');
            scnt[j]++;
        } else {
            cout << s[i];
        }
    cout << '\n';
    return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#define lo(i, n, m) for(int i = n; i < m; i++)

using namespace std;

typedef long long LL;

const int LIM = 30;
int scnt[LIM], tcnt[LIM];

inline int mini(int a, int b) {return a < b ? a : b;}

int main(void) {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    string s, t;
    cin >> s >> t;
    int markcnt = 0;
    lo(i, 0, s.size())
        if (s[i] == '?') markcnt++;
        else scnt[s[i] - 'a']++;
    lo(i, 0, t.size()) tcnt[t[i] - 'a']++;
    int l = 0, r = s.size();
    while (l < r) {
        int mid = l + ((r - l) >> 1);
        LL tmp = 0;
        lo(i, 0, 26) tmp += tcnt[i] * mid - mini(tcnt[i] * mid, scnt[i]);
        if (tmp < markcnt) l = mid + 1;
        else r = mid;
    }
    int j = 0;
    lo(i, 0, s.size())
        if (s[i] == '?') {
            while (j < 25 && scnt[j] >= tcnt[j] * l) j++;
            cout << (char)(j + 'a');
            scnt[j]++;
        } else {
            cout << s[i];
        }
    cout << '\n';
    return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#define lo(i, n, m) for(int i = n; i < m; i++)

using namespace std;

const int LIM = 30;
int scnt[LIM],  tcnt[LIM];

inline int mini(int a, int b) {return a < b ? a : b;}

int main(void) {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    string s, t;
    cin >> s >> t;
    int markcnt = 0;
    lo(i, 0, s.size())
        if (s[i] == '?') markcnt++;
        else scnt[s[i] - 'a']++;
    lo(i, 0, t.size()) tcnt[t[i] - 'a']++;
    int l = 0, r = (s.size() + t.size() - 1) / t.size();
    while (l < r) {
        int mid = l + (r - l) >> 1;
        int tmp = 0;
        lo(i, 0, 26) tmp += tcnt[i] * mid - mini(tcnt[i] * mid, scnt[i]);
        if (tmp < markcnt) l = mid + 1;
        else r = mid;
    }
    int j = 0;
    lo(i, 0, s.size())
        if (s[i] == '?') {
            while (j < 25 && scnt[j] >= tcnt[j] * l) j++;
            cout << (char)(j + 'a');
            scnt[j]++;
        } else {
            cout << s[i];
        }
    cout << '\n';
    return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#define lo(i, n, m) for(int i = n; i < m; i++)

using namespace std;

const int LIM = 30;
int scnt[LIM],  tcnt[LIM];

inline int mini(int a, int b) {return a < b ? a : b;}

int main(void) {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    string s, t;
    cin >> s >> t;
    int markcnt = 0;
    lo(i, 0, s.size())
        if (s[i] == '?') markcnt++;
        else scnt[s[i] - 'a']++;
    lo(i, 0, t.size()) tcnt[t[i] - 'a']++;
    int l = 0, r = (s.size() + t.size() - 1) / t.size();
    while (l < r) {
        int mid = l + ((r - l) >> 1);
        int tmp = 0;
        lo(i, 0, 26) tmp += tcnt[i] * mid - mini(tcnt[i] * mid, scnt[i]);
        if (tmp < markcnt) l = mid + 1;
        else r = mid;
    }
    int j = 0;
    lo(i, 0, s.size())
        if (s[i] == '?') {
            while (j < 25 && scnt[j] >= tcnt[j] * l) j++;
            cout << (char)(j + 'a');
            scnt[j]++;
        } else {
            cout << s[i];
        }
    cout << '\n';
    return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#define lo(i, n, m) for(int i = n; i < m; i++)

using namespace std;

typedef long long LL;

const int LIM = 30;
int scnt[LIM], tcnt[LIM];

inline int mini(int a, int b) {return a < b ? a : b;}

int main(void) {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    string s, t;
    cin >> s >> t;
    int markcnt = 0;
    lo(i, 0, s.size())
        if (s[i] == '?') markcnt++;
        else scnt[s[i] - 'a']++;
    lo(i, 0, t.size()) tcnt[t[i] - 'a']++;
    int l = 0, r = s.size();
    while (l < r) {
        int mid = l + ((r - l) >> 1);
        LL tmp = 0;
        lo(i, 0, 26) tmp += tcnt[i] * mid - mini(tcnt[i] * mid, scnt[i]);
        if (tmp <= markcnt) l = mid + 1;
        else r = mid;
    }
    int j = 0;
    lo(i, 0, s.size())
        if (s[i] == '?') {
            while (j < 25 && scnt[j] >= tcnt[j] * l) j++;
            cout << (char)(j + 'a');
            scnt[j]++;
        } else {
            cout << s[i];
        }
    cout << '\n';
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int hasha[27] , hashb[27];

int a[27];

int main()
{
    string s1 , s2;

    cin >> s1 >> s2;

    int len1 = s1.size();

    int len2 = s2.size();

    int c = 0;

    for(int i = 0 ; i<s1.size() ; i++)
    {
        if(s1[i]!='?')
        hasha[s1[i]-'a']++;
        else
            c++;
    }

    for(int i = 0 ; i<s2.size() ; i++)
    {
        hashb[s2[i]-'a']++;
    }

    int x = 0;

    for(int i = 0 ;i<26 ; i++)
    {
        if(hashb[i])
            x++;
    }

    int y = len1/x;

    for(int i = 0 ; i<26 ; i++)
    {
        if(hashb[i])
        {
            a[i] = abs(hasha[i] - y);
        }
    }

    int idx = 0;

    string ans;

    for(int i = 0 ; i<s1.size() ; i++)
    {
        while(a[idx]==0)
        {
            idx++;
            if(idx>=26)
            {
                break;
            }
        }
        if(s1[i]=='?')
        {
            ans+=(idx+'a');
            a[idx]--;
        }
        else
        {
            ans+=s1[i];
        }
    }

    cout << ans;

}


#include<bits/stdc++.h>
using namespace std;
vector<char> v;
int hashs[26];
int main()
{
    string s , t;

    cin >> s >> t;

    int c=0;

    for(int i = 0 ; i<s.size() ; i++)
    {
        if(s[i]=='?')
        {
            c++;
        }
        else
        {
            hashs[s[i]-'a']++;
        }
    }
    int len = t.size();

    for(int i = 0 ; i<s.size() ; i++)
    {
        if(hashs[t[i%len] - 'a']>0)
            hashs[t[i%len] - 'a']--;
        else if(c>0)
        {
            v.push_back(t[i%len]);
            c--;
        }
    }

    for(int i = 0 ; i < s.size() ; i++)
    {
        if(s[i]=='?')
        {
            cout << v.back();
            v.pop_back();
        }
        else{
            cout<< s[i];
        }
    }
}


#include<bits/stdc++.h>
using namespace std;
vector<char> v;
int hashs[26];
int main()
{
    string s , t;

    cin >> s >> t;

    int c=0;

    for(int i = 0 ; i<s.size() ; i++)
    {
        if(s[i]=='?')
        {
            c++;
        }
        else
        {
            hashs[s[i]-'a']++;
        }
    }
    int len = t.size();

    for(int i = 0 ; i<s.size() ; i++)
    {
        if(hashs[t[i%len]]>0)
            hashs[t[i%len]]--;
        else if(c>0)
        {
            v.push_back(t[i%len]);
            c--;
        }
    }

    for(int i = 0 ; i < s.size() ; i++)
    {
        if(s[i]=='?')
        {
            cout << v.back();
            v.pop_back();
        }
        else{
            cout<< s[i];
        }
    }
}


#include<bits/stdc++.h>
using namespace std;

int hasha[27] , hashb[27];

int a[27];

int main()
{
    string s1 , s2;

    cin >> s1 >> s2;

    int len1 = s1.size();

    int len2 = s2.size();

    int c = 0;

    for(int i = 0 ; i<s1.size() ; i++)
    {
        if(s1[i]!='?')
        hasha[s1[i]-'a']++;
        else
            c++;
    }

    for(int i = 0 ; i<s2.size() ; i++)
    {
        hashb[s2[i]-'a']++;
    }

    int x = 0;

    for(int i = 0 ;i<26 ; i++)
    {
        if(hashb[i])
            x++;
    }

    int y = len1/x;

    for(int i = 0 ; i<26 ; i++)
    {
        if(hashb[i])
        {
            a[i] = hashb[i]*abs(hasha[i] - y);
        }
    }

    int idx = 0;

    string ans;

    for(int i = 0 ; i<s1.size() ; i++)
    {
        while(a[idx]==0)
        {
            idx++;
            if(idx>=26)
            {
                break;
            }
        }
        if(s1[i]=='?')
        {
            ans+=(idx+'a');
            a[idx]--;
        }
        else
        {
            ans+=s1[i];
        }
    }

    if(ans.size()<len1)
    {
        for(int i = 0 ; i<26 ; i++)
        {
            if(a[i])
            {
                ans+=(i+'a');
                if(ans.size()==len2)
                    break;
            }
        }
    }

    cout << ans;

}


#include<bits/stdc++.h>
using namespace std;

int hasha[27] , hashb[27];

int a[27];

int main()
{
    string s1 , s2;

    cin >> s1 >> s2;

    int len1 = s1.size();

    int len2 = s2.size();

    int c = 0;

    for(int i = 0 ; i<s1.size() ; i++)
    {
        if(s1[i]!='?')
        hasha[s1[i]-'a']++;
        else
            c++;
    }

    for(int i = 0 ; i<s2.size() ; i++)
    {
        hashb[s2[i]-'a']++;
    }

    int x = 0;

    for(int i = 0 ;i<26 ; i++)
    {
        if(hashb[i])
            x++;
    }

    int y = len1/x;

    for(int i = 0 ; i<26 ; i++)
    {
        if(hashb[i])
        {
            a[i] = abs(hasha[i] - y);
        }
    }

    int idx = 0;

    string ans;

    for(int i = 0 ; i<s1.size() ; i++)
    {
        while(a[idx]==0)
        {
            idx++;
            if(idx>=26)
            {
                break;
            }
        }
        if(s1[i]=='?')
        {
            ans+=(idx+'a');
            a[idx]--;
        }
        else
        {
            ans+=s1[i];
        }
    }

    if(ans.size()<len1)
    {
        for(int i = 0 ; i<26 ; i++)
        {
            if(a[i])
            {
                ans+=(i+'a');
                if(ans.size()==len2)
                    break;
            }
        }
    }

    cout << ans;

}


#include<bits/stdc++.h>
using namespace std;

int hasha[27] , hashb[27];

int a[27];

int main()
{
    string s1 , s2;

    cin >> s1 >> s2;

    int len1 = s1.size();

    int len2 = s2.size();

    int c = 0;

    for(int i = 0 ; i<s1.size() ; i++)
    {
        if(s1[i]!='?')
        hasha[s1[i]-'a']++;
        else
            c++;
    }

    for(int i = 0 ; i<s2.size() ; i++)
    {
        hashb[s2[i]-'a']++;
    }

    int x = 0;

    for(int i = 0 ;i<26 ; i++)
    {
        if(hashb[i])
            x++;
    }

    int y = len1/x;

    for(int i = 0 ; i<26 ; i++)
    {
        if(hashb[i])
        {
            a[i] = hashb[i]*abs(hasha[i] - y);
        }
    }

    int idx = 0;

    string ans;

    for(int i = 0 ; i<s1.size() ; i++)
    {
        while(a[idx]==0)
        {
            idx++;
            if(idx>=26)
            {
                idx = 0;
            }
        }
        if(s1[i]=='?')
        {
            ans+=(idx+'a');
            a[idx]--;
        }
        else
        {
            ans+=s1[i];
        }
    }

    if(ans.size()<len1)
    {
        for(int i = 0 ; i<26 ; i++)
        {
            if(a[i])
            {
                ans+=(i+'a');
                if(ans.size()==len2)
                    break;
            }
        }
    }

    cout << ans;

}


#include<iostream>
#include<string>
#include<map>

using namespace std;

int main()
{
	string heap, pattern;
	map<char, int> heap_symbol_to_count, pattern_symbol_to_count, shop;
	int gaps, possible_entries;
	bool can_enter;

	cin >> heap >> pattern;
	for (int i = 0; i < heap.size(); i++)
		heap_symbol_to_count[heap[i]]++;
	for (int i = 0; i < pattern.size(); i++)
		pattern_symbol_to_count[pattern[i]]++;
	gaps = heap_symbol_to_count['?'];
	possible_entries = LONG_MAX;
	for (auto it = pattern_symbol_to_count.begin(); it != pattern_symbol_to_count.end(); it.operator++())
	{
		pair<char, int> current_pair = *it;
		char current_character = current_pair.first;
		int current_count = current_pair.second;
		possible_entries = min(possible_entries, heap_symbol_to_count[current_character] % current_count);
	}
	for (auto it = heap_symbol_to_count.begin(); it != heap_symbol_to_count.end(); it.operator++())
		it->second -= possible_entries * pattern_symbol_to_count[it->first];
	can_enter = true;
	while (can_enter)
	{
		for (auto it = heap_symbol_to_count.begin(); it != heap_symbol_to_count.end(); it.operator++())
		{
			if (it->second >= pattern_symbol_to_count[it->first]) it->second -= pattern_symbol_to_count[it->first];
			else
			{
				int lack = pattern_symbol_to_count[it->first] - it->second;
				if (gaps < lack) { can_enter = false; break;}
				else
				{
					gaps -= lack;
					it->second = 0;
					shop[it->first] += lack;
				}
			}
		}
	}
	auto it = shop.begin();
	for (int i = 0; i < heap[i]; i++)
	{
		if (heap[i] != '?') cout << heap[i];
		else
		{
			if (it != shop.end())
			{
				cout << it->first;
				it->second--;
				if (it->second == 0) it.operator++();
			}
			else
				cout << 'a';
		}
	}
	return 0;
}


#include<iostream>
#include<string>
#include<map>

using namespace std;

int main()
{
	string heap, pattern;
	map<char, int> cnt_heap, cnt_pattern, shop;
	int gaps, l, r, entries;

	getline(cin, heap);
	getline(cin, pattern);
	for (int i = 0; i < heap.size(); i++)
		cnt_heap[heap[i]]++;
	for (int i = 0; i < pattern.size(); i++)
		cnt_pattern[pattern[i]]++;
	gaps = cnt_heap['?'];
	l = 0; r = heap.size() + 1;
	while (r - l > 1)
	{
		int m, neccesary_gaps;
		bool check;
		m = (l + r) / 2;
		neccesary_gaps = 0;
		for (char c = 'a'; c <= 'z'; c++)
		{
			auto it = cnt_pattern.find(c);
			if (it == cnt_pattern.end()) continue;
			else
				neccesary_gaps += it->second * m - min(it->second * m, cnt_heap[c]);
		}
		check = (neccesary_gaps <= gaps);
		if (check) l = m;
		else
			r = m;
	}
	entries = l;
	for (auto it = cnt_pattern.begin(); it != cnt_pattern.end(); it.operator++())
	{
		if (it->second * entries > cnt_heap[it->first])
			shop[it->first] = it->second * entries- cnt_heap[it->first];
	}
	auto it = shop.begin();
	for (int i = 0; i < heap.size(); i++)
	{
		if (heap[i] == '?')
		{
			if (it == shop.end()) heap[i] = 'a';
			else
			{
				heap[i] = it->first;
				it->second--;
				if (it->second == 0) it.operator++();
			}
		}
	}
	cout << heap << endl;
	return 0;
}


#include<iostream>
#include<string>
#include<map>

using namespace std;

int main()
{
	cin.precision(1e9);
	cout.precision(1e9);
	string heap, pattern;
	map<char, int> heap_symbol_to_count, pattern_symbol_to_count, shop;
	int gaps, possible_entries;
	bool can_enter;

	cin >> heap >> pattern;
	for (int i = 0; i < heap.size(); i++)
		heap_symbol_to_count[heap[i]]++;
	for (int i = 0; i < pattern.size(); i++)
		pattern_symbol_to_count[pattern[i]]++;
	gaps = heap_symbol_to_count['?'];
	possible_entries = LONG_MAX;
	for (auto it = pattern_symbol_to_count.begin(); it != pattern_symbol_to_count.end(); it.operator++())
	{
		pair<char, int> current_pair = *it;
		char current_character = current_pair.first;
		int current_count = current_pair.second;
		possible_entries = min(possible_entries, heap_symbol_to_count[current_character] % current_count);
	}
	for (auto it = heap_symbol_to_count.begin(); it != heap_symbol_to_count.end(); it.operator++())
		it->second -= possible_entries * pattern_symbol_to_count[it->first];
	can_enter = true;
	while (can_enter)
	{
		for (auto it = heap_symbol_to_count.begin(); it != heap_symbol_to_count.end(); it.operator++())
		{
			if (it->second >= pattern_symbol_to_count[it->first]) it->second -= pattern_symbol_to_count[it->first];
			else
			{
				int lack = pattern_symbol_to_count[it->first] - it->second;
				if (gaps < lack) { can_enter = false; break;}
				else
				{
					gaps -= lack;
					it->second = 0;
					shop[it->first] += lack;
				}
			}
		}
	}

	auto it = shop.begin();
	for (int i = 0; i < heap[i]; i++)
	{
		if (heap[i] != '?') cout << heap[i];
		else
		{
			if (it != shop.end())
			{
				cout << it->first;
				it->second--;
				if (it->second == 0) it.operator++();
			}
			else
				cout << 'a';
		}
	}
	return 0;
}


#include<iostream>
#include<string>
#include<map>

using namespace std;

string heap, pattern;
map<char, int> cnt_heap, cnt_pattern, shop;
int gaps, l, r, entries;

bool check_k(int m)
{
	int neccesary_gaps = 0;
	for (char c = 'a'; c <= 'z'; c++)
	{
		auto it = cnt_pattern.find(c);
		if (it == cnt_pattern.end()) continue;
		else
			neccesary_gaps += it->second * m - min(it->second * m, cnt_heap[c]);
	}
	return (neccesary_gaps <= gaps);
}

int main()
{
	getline(cin, heap);
	getline(cin, pattern);
	for (int i = 0; i < heap.size(); i++)
		cnt_heap[heap[i]]++;
	for (int i = 0; i < pattern.size(); i++)
		cnt_pattern[pattern[i]]++;
	gaps = cnt_heap['?'];
	l = 0; r = heap.size() + 1;
	while (r - l > 1)
	{
		int m, neccesary_gaps;
		bool check;
		m = (l + r) / 2;
		if (check_k(m)) l = m;
		else
			r = m;
	}
	if (check_k(r)) entries = r;
	else
		entries = l;
	for (auto it = cnt_pattern.begin(); it != cnt_pattern.end(); it.operator++())
	{
		if (it->second * entries > cnt_heap[it->first])
			shop[it->first] = it->second * entries- cnt_heap[it->first];
	}
	auto it = shop.begin();
	for (int i = 0; i < heap.size(); i++)
	{
		if (heap[i] == '?')
		{
			if (it == shop.end()) heap[i] = 'a';
			else
			{
				heap[i] = it->first;
				it->second--;
				if (it->second == 0) it.operator++();
			}
		}
	}
	cout << heap << endl;
	return 0;
}


#include<iostream>
#include<string>
#include<map>
#define ll long long

using namespace std;

string heap, pattern;
map<char, ll> cnt_heap, cnt_pattern, shop;
ll gaps, l, r, entries;

bool check_k(ll m)
{
	ll neccesary_gaps = 0;
	for (char c = 'a'; c <= 'z'; c++)
	{
		auto it = cnt_pattern.find(c);
		if (it == cnt_pattern.end()) continue;
		else
			neccesary_gaps += it->second * m - min(it->second * m, cnt_heap[c]);
	}
	return (neccesary_gaps <= gaps);
}

int main()
{
	getline(cin, heap);
	getline(cin, pattern);
	for (ll i = 0; i < heap.size(); i++)
		cnt_heap[heap[i]]++;
	for (ll i = 0; i < pattern.size(); i++)
		cnt_pattern[pattern[i]]++;
	gaps = cnt_heap['?'];
	l = 0; r = heap.size() + 1;
	while (r - l > 1)
	{
		ll m;
		m = (l + r) / 2;
		if (check_k(m)) l = m;
		else
			r = m;
	}
	if (check_k(r)) entries = r;
	else
		entries = l;
	for (auto it = cnt_pattern.begin(); it != cnt_pattern.end(); it.operator++())
	{
		if (it->second * entries > cnt_heap[it->first])
			shop[it->first] = it->second * entries- cnt_heap[it->first];
	}
	auto it = shop.begin();
	for (ll i = 0; i < heap.size(); i++)
	{
		if (heap[i] == '?')
		{
			if (it == shop.end()) heap[i] = 'a';
			else
			{
				heap[i] = it->first;
				it->second--;
				if (it->second == 0) it.operator++();
			}
		}
	}
	cout << heap << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#if DEBUG && !ONLINE_JUDGE
    #define debug(args...)  (Debugger()),args
    class Debugger{
        public:
            Debugger(const string& _seperator = ", "):
                fi(true),seperator(_seperator){}
            template<typename T> Debugger& operator , (const T& v){
                if(!fi)
                    cerr<<seperator;
                cerr<<v;
                fi=false;
                return *this;
            }
            ~Debugger() {cerr<<endl;}
        private:
            bool fi;
            string seperator;
    };
    #define DBG(x) {cerr << #x << " = "; debug(x);}
    template<typename T> inline ostream& operator << (ostream& os,const vector<T>& v){
        bool fi=true;
        os<<"[";
        for(auto i:v){
            if(!fi)
                os<<", ";
            os<<i;
            fi=false;
        }
        return os<<"]";
    }
#else
    #define debug(args...)
    #define DBG(x)
#endif

typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
typedef map<int,int> mii;
typedef map<string,int> msi;
typedef long long lli;

#define pb push_back
#define IT iterator
#define PQ priority_queue
#define GI greater<int>
#define _1 first
#define _2 second
#define fi first
#define se second
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define REP(i,a) FOR(i,0,(int)(a)-1)
#define FORd(i,a,b) for(int i=(a);i>=(b);i--)
#define TR(c,it) for(auto it:(c))
#define all(x) x.begin(), x.end()
#define uni(x) x.erase(unique(all(x)), x.end())
#define sqr(x) ((x)*(x))
#define L(x) ((x)<<1)
#define R(x) (((x)<<1)+1)
#define EPS 1e-9
#define EULER 2.7182818284
#define MOD 1000000007

const double PI=3.14159265358979323846264338327950288419716939937510582097494459230;
template<typename T> inline T gcd(T a,T b) {if(a==0)return b;return gcd(b%a,a);}
template<typename T> inline void amin(T& x,T y) {if(x>y)x=y;}
template<typename T> inline void amax(T& x,T y) {if(x<y)x=y;}
class comp{
public:
    bool operator()(const ii& a, const ii& b){
        if(a.fi!=b.fi){
            return a._1<b._1;
        }else{
            return a._2>b._2;
        }
    }
};
//global variables

//end global variables

void preprocess(void){
    return;
}

int main(void){
    //freopen("output.txt","w",stdout);
    //freopen("input.txt","r",stdin);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.precision(20);
    preprocess();
    int teeee;
    //cin>>t;
    teeee=1;
    FOR(zeeee,1,teeee){
        //printf("Case #%d: ",z);
        string s,t;
        cin>>s>>t;
        int len=s.size();
        int q=0;
        vi s1(26,0),t1(26,0);
        REP(i,len){
            if(s[i]=='?'){
                q++;
            }else{
                s1[s[i]-'a']++;
            }
            t1[t[i]-'a']++;
        }
        int l=0,r=len;
        while(l<r){
            int m=(l+r)>>1;
            int tans=0;
            REP(i,26){
                tans+=t1[i]*m-min(t1[i]*m,s1[i]);
            }
            debug(l,r,tans,m,q);
            if(q==0){
                break;
            }
            if(l==r-1){
                if(l==0){
                    l++;
                }
                break;
            }
            if(tans<=q){
                l=m;
            }else{
                r=m-1;
            }
        }
        int ind=0;
        int cur=0;
        REP(i,len){
            while(cur==0){
                if(ind>=26){
                    break;
                }
                cur=t1[ind]*l-min(t1[ind]*l,s1[ind]);
                ind++;
            }
            debug(cur,ind);
            if(s[i]=='?'){
                if(ind>26){
                    ind=26;
                }
                s[i]='a'+ind-1;
                cur--;
            }
        }
        cout<<s<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#if DEBUG && !ONLINE_JUDGE
    #define debug(args...)  (Debugger()),args
    class Debugger{
        public:
            Debugger(const string& _seperator = ", "):
                fi(true),seperator(_seperator){}
            template<typename T> Debugger& operator , (const T& v){
                if(!fi)
                    cerr<<seperator;
                cerr<<v;
                fi=false;
                return *this;
            }
            ~Debugger() {cerr<<endl;}
        private:
            bool fi;
            string seperator;
    };
    #define DBG(x) {cerr << #x << " = "; debug(x);}
    template<typename T> inline ostream& operator << (ostream& os,const vector<T>& v){
        bool fi=true;
        os<<"[";
        for(auto i:v){
            if(!fi)
                os<<", ";
            os<<i;
            fi=false;
        }
        return os<<"]";
    }
#else
    #define debug(args...)
    #define DBG(x)
#endif

typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
typedef map<int,int> mii;
typedef map<string,int> msi;
typedef long long lli;

#define pb push_back
#define IT iterator
#define PQ priority_queue
#define GI greater<int>
#define _1 first
#define _2 second
#define fi first
#define se second
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define REP(i,a) FOR(i,0,(int)(a)-1)
#define FORd(i,a,b) for(int i=(a);i>=(b);i--)
#define TR(c,it) for(auto it:(c))
#define all(x) x.begin(), x.end()
#define uni(x) x.erase(unique(all(x)), x.end())
#define sqr(x) ((x)*(x))
#define L(x) ((x)<<1)
#define R(x) (((x)<<1)+1)
#define EPS 1e-9
#define EULER 2.7182818284
#define MOD 1000000007

const double PI=3.14159265358979323846264338327950288419716939937510582097494459230;
template<typename T> inline T gcd(T a,T b) {if(a==0)return b;return gcd(b%a,a);}
template<typename T> inline void amin(T& x,T y) {if(x>y)x=y;}
template<typename T> inline void amax(T& x,T y) {if(x<y)x=y;}
class comp{
public:
    bool operator()(const ii& a, const ii& b){
        if(a.fi!=b.fi){
            return a._1<b._1;
        }else{
            return a._2>b._2;
        }
    }
};
//global variables

//end global variables

void preprocess(void){
    return;
}

int main(void){
    //freopen("output.txt","w",stdout);
    //freopen("input.txt","r",stdin);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.precision(20);
    preprocess();
    int teeee;
    //cin>>t;
    teeee=1;
    FOR(zeeee,1,teeee){
        //printf("Case #%d: ",z);
        string s,t;
        cin>>s>>t;
        int len=s.size();
        int q=0;
        vi s1(26,0),t1(26,0);
        REP(i,len){
            if(s[i]=='?'){
                q++;
            }else{
                s1[s[i]-'a']++;
            }
            t1[t[i]-'a']++;
        }
        int l=0,r=len;
        while(l<r){
            int m=(l+r)>>1;
            int tans=0;
            REP(i,26){
                tans+=t1[i]*m-min(t1[i]*m,s1[i]);
            }
            debug(l,r,tans,m,q);
            if(q==0){
                if(tans<=q){
                    l=0;
                    break;
                }
            }
            if(l==r-1){
                if(l==0){
                    l++;
                }
                break;
            }
            if(tans<=q){
                l=m;
            }else{
                r=m-1;
            }
        }
        int ind=0;
        int cur=0;
        REP(i,len){
            while(cur==0){
                if(ind>26){
                    break;
                }
                cur=t1[ind]*l-min(t1[ind]*l,s1[ind]);
                ind++;
            }
            debug(cur,ind);
            if(s[i]=='?'){
                if(ind>26){
                    ind=26;
                }
                s[i]='a'+ind-1;
                cur--;
            }
        }
        cout<<s<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#if DEBUG && !ONLINE_JUDGE
    #define debug(args...)  (Debugger()),args
    class Debugger{
        public:
            Debugger(const string& _seperator = ", "):
                fi(true),seperator(_seperator){}
            template<typename T> Debugger& operator , (const T& v){
                if(!fi)
                    cerr<<seperator;
                cerr<<v;
                fi=false;
                return *this;
            }
            ~Debugger() {cerr<<endl;}
        private:
            bool fi;
            string seperator;
    };
    #define DBG(x) {cerr << #x << " = "; debug(x);}
    template<typename T> inline ostream& operator << (ostream& os,const vector<T>& v){
        bool fi=true;
        os<<"[";
        for(auto i:v){
            if(!fi)
                os<<", ";
            os<<i;
            fi=false;
        }
        return os<<"]";
    }
#else
    #define debug(args...)
    #define DBG(x)
#endif

typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
typedef map<int,int> mii;
typedef map<string,int> msi;
typedef long long lli;

#define pb push_back
#define IT iterator
#define PQ priority_queue
#define GI greater<int>
#define _1 first
#define _2 second
#define fi first
#define se second
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define REP(i,a) FOR(i,0,(int)(a)-1)
#define FORd(i,a,b) for(int i=(a);i>=(b);i--)
#define TR(c,it) for(auto it:(c))
#define all(x) x.begin(), x.end()
#define uni(x) x.erase(unique(all(x)), x.end())
#define sqr(x) ((x)*(x))
#define L(x) ((x)<<1)
#define R(x) (((x)<<1)+1)
#define EPS 1e-9
#define EULER 2.7182818284
#define MOD 1000000007

const double PI=3.14159265358979323846264338327950288419716939937510582097494459230;
template<typename T> inline T gcd(T a,T b) {if(a==0)return b;return gcd(b%a,a);}
template<typename T> inline void amin(T& x,T y) {if(x>y)x=y;}
template<typename T> inline void amax(T& x,T y) {if(x<y)x=y;}
class comp{
public:
    bool operator()(const ii& a, const ii& b){
        if(a.fi!=b.fi){
            return a._1<b._1;
        }else{
            return a._2>b._2;
        }
    }
};
//global variables

//end global variables

void preprocess(void){
    return;
}

int main(void){
    //freopen("output.txt","w",stdout);
    //freopen("input.txt","r",stdin);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.precision(20);
    preprocess();
    int teeee;
    //cin>>t;
    teeee=1;
    FOR(zeeee,1,teeee){
        //printf("Case #%d: ",z);
        string s,t;
        cin>>s>>t;
        int len=s.size();
        int q=0;
        vi s1(26,0),t1(26,0);
        REP(i,len){
            if(s[i]=='?'){
                q++;
            }else{
                s1[s[i]-'a']++;
            }
            t1[t[i]-'a']++;
        }
        int l=0,r=len;
        while(l<r){
            int m=(l+r)>>1;
            int tans=0;
            REP(i,26){
                tans+=t1[i]*m-min(t1[i]*m,s1[i]);
            }
            if(q==0){
                if(tans<=q){
                    l=0;
                    break;
                }
            }
            if(l==r-1){
                l++;
                break;
            }
            debug(l,r,tans,m,q);
            if(tans<=q){
                l=m;
            }else{
                r=m-1;
            }
        }
        int ind=0;
        int cur=0;
        REP(i,len){
            while(cur==0){
                cur=t1[ind]*l-min(t1[ind]*l,s1[ind]);
                if(ind>26){
                    break;
                }
                ind++;
            }
            debug(cur,ind);
            if(s[i]=='?'){
                if(ind>26){
                    ind=26;
                }
                s[i]='a'+ind-1;
                cur--;
            }
        }
        cout<<s<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#if DEBUG && !ONLINE_JUDGE
    #define debug(args...)  (Debugger()),args
    class Debugger{
        public:
            Debugger(const string& _seperator = ", "):
                fi(true),seperator(_seperator){}
            template<typename T> Debugger& operator , (const T& v){
                if(!fi)
                    cerr<<seperator;
                cerr<<v;
                fi=false;
                return *this;
            }
            ~Debugger() {cerr<<endl;}
        private:
            bool fi;
            string seperator;
    };
    #define DBG(x) {cerr << #x << " = "; debug(x);}
    template<typename T> inline ostream& operator << (ostream& os,const vector<T>& v){
        bool fi=true;
        os<<"[";
        for(auto i:v){
            if(!fi)
                os<<", ";
            os<<i;
            fi=false;
        }
        return os<<"]";
    }
#else
    #define debug(args...)
    #define DBG(x)
#endif

typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
typedef map<int,int> mii;
typedef map<string,int> msi;
typedef long long lli;

#define pb push_back
#define IT iterator
#define PQ priority_queue
#define GI greater<int>
#define _1 first
#define _2 second
#define fi first
#define se second
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define REP(i,a) FOR(i,0,(int)(a)-1)
#define FORd(i,a,b) for(int i=(a);i>=(b);i--)
#define TR(c,it) for(auto it:(c))
#define all(x) x.begin(), x.end()
#define uni(x) x.erase(unique(all(x)), x.end())
#define sqr(x) ((x)*(x))
#define L(x) ((x)<<1)
#define R(x) (((x)<<1)+1)
#define EPS 1e-9
#define EULER 2.7182818284
#define MOD 1000000007

const double PI=3.14159265358979323846264338327950288419716939937510582097494459230;
template<typename T> inline T gcd(T a,T b) {if(a==0)return b;return gcd(b%a,a);}
template<typename T> inline void amin(T& x,T y) {if(x>y)x=y;}
template<typename T> inline void amax(T& x,T y) {if(x<y)x=y;}
class comp{
public:
    bool operator()(const ii& a, const ii& b){
        if(a.fi!=b.fi){
            return a._1<b._1;
        }else{
            return a._2>b._2;
        }
    }
};
//global variables

//end global variables

void preprocess(void){
    return;
}

int main(void){
    //freopen("output.txt","w",stdout);
    //freopen("input.txt","r",stdin);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.precision(20);
    preprocess();
    int teeee;
    //cin>>t;
    teeee=1;
    FOR(zeeee,1,teeee){
        //printf("Case #%d: ",z);
        string s,t;
        cin>>s>>t;
        int len=s.size();
        int q=0;
        vi s1(26,0),t1(26,0);
        REP(i,len){
            if(s[i]=='?'){
                q++;
            }else{
                s1[s[i]-'a']++;
            }
        }
        int re=t.size();
        REP(i,re){
            t1[t[i]-'a']++;
        }
        int l=0;
        while(l<=max(len,re)+1){
            int tans=0;
            REP(i,26){
                tans+=t1[i]*l-min(t1[i]*l,s1[i]);
            }
            DBG(tans);
            if(tans>q){
                l--;
                break;
            }
            l++;
        }
        DBG(l);
        int ind=0;
        int cur=0;
        REP(i,len){
            if(q==0){
                break;
            }
            while(cur==0){
                if(ind>=26){
                    ind=26;
                    break;
                }
                cur=t1[ind]*l-min(t1[ind]*l,s1[ind]);
                ind++;
            }
            debug(cur,ind);
            if(s[i]=='?'){
                s[i]='a'+ind-1;
                cur--;
            }
        }
        cout<<s<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#if DEBUG && !ONLINE_JUDGE
    #define debug(args...)  (Debugger()),args
    class Debugger{
        public:
            Debugger(const string& _seperator = ", "):
                fi(true),seperator(_seperator){}
            template<typename T> Debugger& operator , (const T& v){
                if(!fi)
                    cerr<<seperator;
                cerr<<v;
                fi=false;
                return *this;
            }
            ~Debugger() {cerr<<endl;}
        private:
            bool fi;
            string seperator;
    };
    #define DBG(x) {cerr << #x << " = "; debug(x);}
    template<typename T> inline ostream& operator << (ostream& os,const vector<T>& v){
        bool fi=true;
        os<<"[";
        for(auto i:v){
            if(!fi)
                os<<", ";
            os<<i;
            fi=false;
        }
        return os<<"]";
    }
#else
    #define debug(args...)
    #define DBG(x)
#endif

typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
typedef map<int,int> mii;
typedef map<string,int> msi;
typedef long long lli;

#define pb push_back
#define IT iterator
#define PQ priority_queue
#define GI greater<int>
#define _1 first
#define _2 second
#define fi first
#define se second
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define REP(i,a) FOR(i,0,(int)(a)-1)
#define FORd(i,a,b) for(int i=(a);i>=(b);i--)
#define TR(c,it) for(auto it:(c))
#define all(x) x.begin(), x.end()
#define uni(x) x.erase(unique(all(x)), x.end())
#define sqr(x) ((x)*(x))
#define L(x) ((x)<<1)
#define R(x) (((x)<<1)+1)
#define EPS 1e-9
#define EULER 2.7182818284
#define MOD 1000000007

const double PI=3.14159265358979323846264338327950288419716939937510582097494459230;
template<typename T> inline T gcd(T a,T b) {if(a==0)return b;return gcd(b%a,a);}
template<typename T> inline void amin(T& x,T y) {if(x>y)x=y;}
template<typename T> inline void amax(T& x,T y) {if(x<y)x=y;}
class comp{
public:
    bool operator()(const ii& a, const ii& b){
        if(a.fi!=b.fi){
            return a._1<b._1;
        }else{
            return a._2>b._2;
        }
    }
};
//global variables

//end global variables

void preprocess(void){
    return;
}

int main(void){
    //freopen("output.txt","w",stdout);
    //freopen("input.txt","r",stdin);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.precision(20);
    preprocess();
    int teeee;
    //cin>>t;
    teeee=1;
    FOR(zeeee,1,teeee){
        //printf("Case #%d: ",z);
        string s,t;
        cin>>s>>t;
        int len=s.size();
        int q=0;
        vi s1(26,0),t1(26,0);
        REP(i,len){
            if(s[i]=='?'){
                q++;
            }else{
                s1[s[i]-'a']++;
            }
        }
        int re=t.size();
        REP(i,re){
            t1[t[i]-'a']++;
        }
        int l=0,r=len;
        while(l<r){
            if(q==0){
                break;
            }
            int m=(l+r)>>1;
            int tans=0;
            REP(i,26){
                tans+=t1[i]*m-min(t1[i]*m,s1[i]);
            }
            debug(l,r,tans,m,q);
            if(l==r-1){
                if(l==0){
                    l++;
                }
                break;
            }
            if(tans<=q){
                l=m;
            }else{
                r=m-1;
            }
        }
        int ind=0;
        int cur=0;
        REP(i,len){
            if(q==0){
                break;
            }
            while(cur==0){
                if(ind>=26){
                    break;
                }
                cur=t1[ind]*l-min(t1[ind]*l,s1[ind]);
                ind++;
            }
            debug(cur,ind);
            if(s[i]=='?'){
                if(ind>26){
                    ind=26;
                }
                s[i]='a'+ind-1;
                cur--;
            }
        }
        cout<<s<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#if DEBUG && !ONLINE_JUDGE
    #define debug(args...)  (Debugger()),args
    class Debugger{
        public:
            Debugger(const string& _seperator = ", "):
                fi(true),seperator(_seperator){}
            template<typename T> Debugger& operator , (const T& v){
                if(!fi)
                    cerr<<seperator;
                cerr<<v;
                fi=false;
                return *this;
            }
            ~Debugger() {cerr<<endl;}
        private:
            bool fi;
            string seperator;
    };
    #define DBG(x) {cerr << #x << " = "; debug(x);}
    template<typename T> inline ostream& operator << (ostream& os,const vector<T>& v){
        bool fi=true;
        os<<"[";
        for(auto i:v){
            if(!fi)
                os<<", ";
            os<<i;
            fi=false;
        }
        return os<<"]";
    }
#else
    #define debug(args...)
    #define DBG(x)
#endif

typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
typedef map<int,int> mii;
typedef map<string,int> msi;
typedef long long lli;

#define pb push_back
#define IT iterator
#define PQ priority_queue
#define GI greater<int>
#define _1 first
#define _2 second
#define fi first
#define se second
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define REP(i,a) FOR(i,0,(int)(a)-1)
#define FORd(i,a,b) for(int i=(a);i>=(b);i--)
#define TR(c,it) for(auto it:(c))
#define all(x) x.begin(), x.end()
#define uni(x) x.erase(unique(all(x)), x.end())
#define sqr(x) ((x)*(x))
#define L(x) ((x)<<1)
#define R(x) (((x)<<1)+1)
#define EPS 1e-9
#define EULER 2.7182818284
#define MOD 1000000007

const double PI=3.14159265358979323846264338327950288419716939937510582097494459230;
template<typename T> inline T gcd(T a,T b) {if(a==0)return b;return gcd(b%a,a);}
template<typename T> inline void amin(T& x,T y) {if(x>y)x=y;}
template<typename T> inline void amax(T& x,T y) {if(x<y)x=y;}
class comp{
public:
    bool operator()(const ii& a, const ii& b){
        if(a.fi!=b.fi){
            return a._1<b._1;
        }else{
            return a._2>b._2;
        }
    }
};
//global variables

//end global variables

void preprocess(void){
    return;
}

int main(void){
    //freopen("output.txt","w",stdout);
    //freopen("input.txt","r",stdin);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.precision(20);
    preprocess();
    int teeee;
    //cin>>t;
    teeee=1;
    FOR(zeeee,1,teeee){
        //printf("Case #%d: ",z);
        string s,t;
        cin>>s>>t;
        int len=s.size();
        int q=0;
        vi s1(26,0),t1(26,0);
        REP(i,len){
            if(s[i]=='?'){
                q++;
            }else{
                s1[s[i]-'a']++;
            }
        }
        int re=t.size();
        REP(i,re){
            t1[t[i]-'a']++;
        }
        int l=0,r=len;
        while(l<r){
            if(q==0){
                break;
            }
            int m=(l+r)>>1;
            int tans=0;
            REP(i,26){
                tans+=t1[i]*m-min(t1[i]*m,s1[i]);
            }
            debug(l,r,tans,m,q);
            if(l==r-1){
                if(l==0){
                    l++;
                }
                break;
            }
            if(tans<=q){
                l=m;
            }else{
                r=m-1;
            }
        }
        int ind=0;
        int cur=0;
        REP(i,len){
            if(q==0){
                break;
            }
            while(cur==0){
                if(ind>=26){
                    ind=26;
                    break;
                }
                cur=t1[ind]*l-min(t1[ind]*l,s1[ind]);
                ind++;
            }
            debug(cur,ind);
            if(s[i]=='?'){
                if(ind>26){
                    ind=26;
                }
                s[i]='a'+ind-1;
                cur--;
            }
        }
        cout<<s<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#if DEBUG && !ONLINE_JUDGE
    #define debug(args...)  (Debugger()),args
    class Debugger{
        public:
            Debugger(const string& _seperator = ", "):
                fi(true),seperator(_seperator){}
            template<typename T> Debugger& operator , (const T& v){
                if(!fi)
                    cerr<<seperator;
                cerr<<v;
                fi=false;
                return *this;
            }
            ~Debugger() {cerr<<endl;}
        private:
            bool fi;
            string seperator;
    };
    #define DBG(x) {cerr << #x << " = "; debug(x);}
    template<typename T> inline ostream& operator << (ostream& os,const vector<T>& v){
        bool fi=true;
        os<<"[";
        for(auto i:v){
            if(!fi)
                os<<", ";
            os<<i;
            fi=false;
        }
        return os<<"]";
    }
#else
    #define debug(args...)
    #define DBG(x)
#endif

typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
typedef map<int,int> mii;
typedef map<string,int> msi;
typedef long long lli;

#define pb push_back
#define IT iterator
#define PQ priority_queue
#define GI greater<int>
#define _1 first
#define _2 second
#define fi first
#define se second
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define REP(i,a) FOR(i,0,(int)(a)-1)
#define FORd(i,a,b) for(int i=(a);i>=(b);i--)
#define TR(c,it) for(auto it:(c))
#define all(x) x.begin(), x.end()
#define uni(x) x.erase(unique(all(x)), x.end())
#define sqr(x) ((x)*(x))
#define L(x) ((x)<<1)
#define R(x) (((x)<<1)+1)
#define EPS 1e-9
#define EULER 2.7182818284
#define MOD 1000000007

const double PI=3.14159265358979323846264338327950288419716939937510582097494459230;
template<typename T> inline T gcd(T a,T b) {if(a==0)return b;return gcd(b%a,a);}
template<typename T> inline void amin(T& x,T y) {if(x>y)x=y;}
template<typename T> inline void amax(T& x,T y) {if(x<y)x=y;}
class comp{
public:
    bool operator()(const ii& a, const ii& b){
        if(a.fi!=b.fi){
            return a._1<b._1;
        }else{
            return a._2>b._2;
        }
    }
};
//global variables

//end global variables

void preprocess(void){
    return;
}

int main(void){
    //freopen("output.txt","w",stdout);
    //freopen("input.txt","r",stdin);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.precision(20);
    preprocess();
    int teeee;
    //cin>>t;
    teeee=1;
    FOR(zeeee,1,teeee){
        //printf("Case #%d: ",z);
        string s,t;
        cin>>s>>t;
        int len=s.size();
        int q=0;
        vi s1(26,0),t1(26,0);
        REP(i,len){
            if(s[i]=='?'){
                q++;
            }else{
                s1[s[i]-'a']++;
            }
            t1[t[i]-'a']++;
        }
        int l=0,r=len;
        while(l<r){
            int m=(l+r)>>1;
            int tans=0;
            REP(i,26){
                tans+=t1[i]*m-min(t1[i]*m,s1[i]);
            }
            debug(l,r,tans,m,q);
            if(q==0){
                if(tans<=q){
                    l=0;
                    break;
                }
            }
            if(l==r-1){
                if(l==0){
                    l++;
                }
                break;
            }
            if(tans<=q){
                l=m;
            }else{
                r=m-1;
            }
        }
        int ind=0;
        int cur=0;
        REP(i,len){
            while(cur==0){
                if(ind>=26){
                    break;
                }
                cur=t1[ind]*l-min(t1[ind]*l,s1[ind]);
                ind++;
            }
            debug(cur,ind);
            if(s[i]=='?'){
                if(ind>26){
                    ind=26;
                }
                s[i]='a'+ind-1;
                cur--;
            }
        }
        cout<<s<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#if DEBUG && !ONLINE_JUDGE
    #define debug(args...)  (Debugger()),args
    class Debugger{
        public:
            Debugger(const string& _seperator = ", "):
                fi(true),seperator(_seperator){}
            template<typename T> Debugger& operator , (const T& v){
                if(!fi)
                    cerr<<seperator;
                cerr<<v;
                fi=false;
                return *this;
            }
            ~Debugger() {cerr<<endl;}
        private:
            bool fi;
            string seperator;
    };
    #define DBG(x) {cerr << #x << " = "; debug(x);}
    template<typename T> inline ostream& operator << (ostream& os,const vector<T>& v){
        bool fi=true;
        os<<"[";
        for(auto i:v){
            if(!fi)
                os<<", ";
            os<<i;
            fi=false;
        }
        return os<<"]";
    }
#else
    #define debug(args...)
    #define DBG(x)
#endif

typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
typedef map<int,int> mii;
typedef map<string,int> msi;
typedef long long lli;

#define pb push_back
#define IT iterator
#define PQ priority_queue
#define GI greater<int>
#define _1 first
#define _2 second
#define fi first
#define se second
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define REP(i,a) FOR(i,0,(int)(a)-1)
#define FORd(i,a,b) for(int i=(a);i>=(b);i--)
#define TR(c,it) for(auto it:(c))
#define all(x) x.begin(), x.end()
#define uni(x) x.erase(unique(all(x)), x.end())
#define sqr(x) ((x)*(x))
#define L(x) ((x)<<1)
#define R(x) (((x)<<1)+1)
#define EPS 1e-9
#define EULER 2.7182818284
#define MOD 1000000007

const double PI=3.14159265358979323846264338327950288419716939937510582097494459230;
template<typename T> inline T gcd(T a,T b) {if(a==0)return b;return gcd(b%a,a);}
template<typename T> inline void amin(T& x,T y) {if(x>y)x=y;}
template<typename T> inline void amax(T& x,T y) {if(x<y)x=y;}
class comp{
public:
    bool operator()(const ii& a, const ii& b){
        if(a.fi!=b.fi){
            return a._1<b._1;
        }else{
            return a._2>b._2;
        }
    }
};
//global variables

//end global variables

void preprocess(void){
    return;
}

int main(void){
    //freopen("output.txt","w",stdout);
    //freopen("input.txt","r",stdin);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.precision(20);
    preprocess();
    int teeee;
    //cin>>t;
    teeee=1;
    FOR(zeeee,1,teeee){
        //printf("Case #%d: ",z);
        string s,t;
        cin>>s>>t;
        int len=s.size();
        int q=0;
        vi s1(26,0),t1(26,0);
        REP(i,len){
            if(s[i]=='?'){
                q++;
            }else{
                s1[s[i]-'a']++;
            }
            t1[t[i]-'a']++;
        }
        int l=0,r=len;
        while(l<r){
            int m=(l+r)>>1;
            int tans=0;
            REP(i,26){
                tans+=t1[i]*m-min(t1[i]*m,s1[i]);
            }
            if(q==0){
                if(tans<=q){
                    l=0;
                    break;
                }
            }
            if(m==0){
                l++;
                break;
            }
            debug(l,r,tans,m,q);
            if(tans<=q){
                l=m;
            }else{
                r=m-1;
            }
        }
        int ind=0;
        int cur=0;
        REP(i,len){
            while(cur==0){
                cur=t1[ind]*l-min(t1[ind]*l,s1[ind]);
                if(ind>26){
                    break;
                }
                ind++;
            }
            debug(cur,ind);
            if(s[i]=='?'){
                if(ind>26){
                    ind=26;
                }
                s[i]='a'+ind-1;
                cur--;
            }
        }
        cout<<s<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#if DEBUG && !ONLINE_JUDGE
    #define debug(args...)  (Debugger()),args
    class Debugger{
        public:
            Debugger(const string& _seperator = ", "):
                fi(true),seperator(_seperator){}
            template<typename T> Debugger& operator , (const T& v){
                if(!fi)
                    cerr<<seperator;
                cerr<<v;
                fi=false;
                return *this;
            }
            ~Debugger() {cerr<<endl;}
        private:
            bool fi;
            string seperator;
    };
    #define DBG(x) {cerr << #x << " = "; debug(x);}
    template<typename T> inline ostream& operator << (ostream& os,const vector<T>& v){
        bool fi=true;
        os<<"[";
        for(auto i:v){
            if(!fi)
                os<<", ";
            os<<i;
            fi=false;
        }
        return os<<"]";
    }
#else
    #define debug(args...)
    #define DBG(x)
#endif

typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
typedef map<int,int> mii;
typedef map<string,int> msi;
typedef long long lli;

#define pb push_back
#define IT iterator
#define PQ priority_queue
#define GI greater<int>
#define _1 first
#define _2 second
#define fi first
#define se second
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define REP(i,a) FOR(i,0,(int)(a)-1)
#define FORd(i,a,b) for(int i=(a);i>=(b);i--)
#define TR(c,it) for(auto it:(c))
#define all(x) x.begin(), x.end()
#define uni(x) x.erase(unique(all(x)), x.end())
#define sqr(x) ((x)*(x))
#define L(x) ((x)<<1)
#define R(x) (((x)<<1)+1)
#define EPS 1e-9
#define EULER 2.7182818284
#define MOD 1000000007

const double PI=3.14159265358979323846264338327950288419716939937510582097494459230;
template<typename T> inline T gcd(T a,T b) {if(a==0)return b;return gcd(b%a,a);}
template<typename T> inline void amin(T& x,T y) {if(x>y)x=y;}
template<typename T> inline void amax(T& x,T y) {if(x<y)x=y;}
class comp{
public:
    bool operator()(const ii& a, const ii& b){
        if(a.fi!=b.fi){
            return a._1<b._1;
        }else{
            return a._2>b._2;
        }
    }
};
//global variables

//end global variables

void preprocess(void){
    return;
}

int main(void){
    //freopen("output.txt","w",stdout);
    //freopen("input.txt","r",stdin);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.precision(20);
    preprocess();
    int teeee;
    //cin>>t;
    teeee=1;
    FOR(zeeee,1,teeee){
        //printf("Case #%d: ",z);
        string s,t;
        cin>>s>>t;
        int len=s.size();
        int q=0;
        vi s1(26,0),t1(26,0);
        REP(i,len){
            if(s[i]=='?'){
                q++;
            }else{
                s1[s[i]-'a']++;
            }
            t1[t[i]-'a']++;
        }
        int l=0,r=len;
        while(l<r){
            if(q==0){
                break;
            }
            int m=(l+r)>>1;
            int tans=0;
            REP(i,26){
                tans+=t1[i]*m-min(t1[i]*m,s1[i]);
            }
            debug(l,r,tans,m,q);
            if(l==r-1){
                if(l==0){
                    l++;
                }
                break;
            }
            if(tans<=q){
                l=m;
            }else{
                r=m-1;
            }
        }
        int ind=0;
        int cur=0;
        REP(i,len){
            if(q==0){
                break;
            }
            while(cur==0){
                if(ind>=26){
                    break;
                }
                cur=t1[ind]*l-min(t1[ind]*l,s1[ind]);
                ind++;
            }
            debug(cur,ind);
            if(s[i]=='?'){
                if(ind>26){
                    ind=26;
                }
                s[i]='a'+ind-1;
                cur--;
            }
        }
        cout<<s<<endl;
    }
    return 0;
}