Problem:
Score : 300 points

Problem Statement

E869120 found a chest which is likely to contain treasure.

However, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.

He also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.

One more thing he found is a sheet of paper with the following facts written on it:

Condition 1: The string S contains a string T as a contiguous substring.

Condition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.

Print the string S.

If such a string does not exist, print UNRESTORABLE.

Constraints

1 \leq |S'|, |T| \leq 50

S' consists of lowercase English letters and ?.

T consists of lowercase English letters.

Input

Input is given from Standard Input in the following format:

S
T'

Output

Print the string S.

If such a string does not exist, print UNRESTORABLE instead.

Sample Input 1

?tc????
coder

Sample Output 1

atcoder

There are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.
Among them, the lexicographically smallest is atcoder, so we can say S = atcoder.

Sample Input 2

??p??d??
abc

Sample Output 2

UNRESTORABLE

There is no string that satisfies Condition 1, so the string S does not exist.

Solution in C (GCC 5.4.1) (judge verdict: Runtime Error)

#include <stdio.h>
#include <string.h>

int main() {

	char s_dash[51];
	char s[51];
	char t[51];

	int i = 0;
	int j = 0;
	int k = 0;
	int l = 0;
	int m = 0; // iは文章中の位置、jは検索文字列中の位置
	int len_s = 0;
	int x = 0;
	int len_t = 0;

	scanf("%s", s_dash);
	scanf("%s", t);
	
//	printf("%s", s_dash);
//	printf("%s", t);

	strcpy(s, s_dash);


	len_s = strlen(s_dash);
	len_t = strlen(t);

	//printf("%d\n", len_s);
	char buf[51];
	char candi[51][51];
	int cnt = 0;
	//printf("%d\n", len_t);
	//printf("%d", i);

	if (len_s < len_t) {
		printf("UNRESTORABLE\n");
	}
	else { 
		for (i = 0; i <= (len_s - len_t); i++) {
			j = 0;
			while(j < len_t) {
				if(s_dash[i+j] == t[j] || s_dash[i+j] == '?') {
					j++;
				}
				else {
					break;
				}
				if(j == len_t){
					// 条件を満たした文字列を保存する
					// 変数cntで、条件を満たした文字列が何個目かを保存しておく。
					// s_dashのiからi+kまでにおいて、'?'以外ならそのまま、'?'ならk番目をコピー
					for (l = 0; l < i; l++) {
						if(s_dash[l] == '?') {
							candi[cnt][l] = 'a';
						}
						else {
							candi[cnt][l] = s_dash[l];
						}
					}
					for (k = 0; k < len_t; k++) {
//						printf("%d", i+k);
						if(s_dash[i+k] == '?') {
							candi[cnt][i+k] = t[k];
						}
						else {
							candi[cnt][i+k] = s_dash[i+k];
						}
					}
					for (m = 0; m < ((len_s - 1) - (i+len_t-1)); m++) {
						//printf("%d\n", m+i+len_t);
						//printf("%s", s_dash[m+i+len_t]);
						if(s_dash[m+i+len_t] == '?') {
							candi[cnt][m+i+len_t] = 'a';
						}
						else {
							candi[cnt][m+i+len_t] = s_dash[m+i+len_t];
						}
					}
					cnt++;
				}
			}
		}
		
		if(cnt == 0) {
			printf("UNRESTORABLE\n");
		}
		else {
			// 変数x。
			// バッファbufの文字列とcandi[x]を比較して、辞書順手前のほうをbufに入れる。
			// xをインクリメント。
			for(x = 0; x < cnt; x++) {
				if (x == 0) {
					strcpy(buf, candi[0]);
				}
				else {
					if (strcmp(buf, candi[x]) > 0) {
						strcpy(buf, candi[x]);
					}
				}
			}
			printf("%s\n", buf);
		}
	}
	return 0;
}