S_raw = eval(input())

T_raw = eval(input())



S = list(S_raw)

T = list(T_raw)



i = 0

j = 0



j_list = []

S_list = []



lt = len(T)

ls = len(S)



while True:

	if (j >= ls) or (i >= lt):

		if i < lt  :

			if j_list == []:

				print("UNRESTORABLE")

				exit(0)

			else:

				break

		elif j < ls:

			j_list.append(j)

			i = 0

			j = j - lt + 1



		else:

			j_list.append(j)

			break



	if T[i] == S[j]:

		i += 1

		j += 1

	elif S[j] == '?':

		i += 1

		j += 1

	else:

		j -= (i - 1)

		i = 0



for k in j_list:

	M = S[:]

	for i,c in zip(list(range(k-lt,k)),T):

		M[i] = c



	S_tmp = ''



	for i in range(ls):

		if M[i] == '?':

			S_tmp += 'a'

		else:

			S_tmp += M[i]



	S_list.append(S_tmp)



S_list.sort()

print((S_list[0]))
S = eval(input())

T = eval(input())



ans = []

sl = len(S)

tl = len(T)

for i in range(sl-tl+1):

	if S[i] == '?' or S[i] == T[0]:

		flg = True

		for j in range(1,tl):

			if S[i+j] != '?' and S[i+j] != T[j]:

				flg = False

				break



		if flg:

			s = S[:i] + T + S[i+tl:]

			ans.append(s.replace('?','a'))



if ans == []:

	print("UNRESTORABLE")

	exit(0)



ans.sort()

print((ans[0]))

S_raw = eval(input())
T_raw = eval(input())
S = list(S_raw)
T = list(T_raw)
i = 0
j = 0
j_list = []
S_list = []
lt = len(T)
ls = len(S)
while True:
    if (j >= ls) or (i >= lt):
        if i < lt:
            if j_list == []:
                print("UNRESTORABLE")
                exit(0)
            else:
                break
        elif j < ls:
            j_list.append(j)
            i = 0
            j = j - lt + 1
        else:
            j_list.append(j)
            break
    if T[i] == S[j]:
        i += 1
        j += 1
    elif S[j] == "?":
        i += 1
        j += 1
    else:
        j -= i - 1
        i = 0
for k in j_list:
    M = S[:]
    for i, c in zip(list(range(k - lt, k)), T):
        M[i] = c
    S_tmp = ""
    for i in range(ls):
        if M[i] == "?":
            S_tmp += "a"
        else:
            S_tmp += M[i]
    S_list.append(S_tmp)
S_list.sort()
print((S_list[0]))

S = eval(input())
T = eval(input())
ans = []
sl = len(S)
tl = len(T)
for i in range(sl - tl + 1):
    if S[i] == "?" or S[i] == T[0]:
        flg = True
        for j in range(1, tl):
            if S[i + j] != "?" and S[i + j] != T[j]:
                flg = False
                break
        if flg:
            s = S[:i] + T + S[i + tl :]
            ans.append(s.replace("?", "a"))
if ans == []:
    print("UNRESTORABLE")
    exit(0)
ans.sort()
print((ans[0]))

-S_raw = eval(input()) -T_raw = eval(input()) -S = list(S_raw) -T = list(T_raw) -i = 0 -j = 0 -j_list = [] -S_list = [] -lt = len(T) -ls = len(S) -while True: -    if (j >= ls) or (i >= lt): -        if i < lt: -            if j_list == []: -                print("UNRESTORABLE") -                exit(0) -            else: +S = eval(input()) +T = eval(input()) +ans = [] +sl = len(S) +tl = len(T) +for i in range(sl - tl + 1): +    if S[i] == "?" or S[i] == T[0]: +        flg = True +        for j in range(1, tl): +            if S[i + j] != "?" and S[i + j] != T[j]: +                flg = False -        elif j < ls: -            j_list.append(j) -            i = 0 -            j = j - lt + 1 -        else: -            j_list.append(j) -            break -    if T[i] == S[j]: -        i += 1 -        j += 1 -    elif S[j] == "?": -        i += 1 -        j += 1 -    else: -        j -= i - 1 -        i = 0 -for k in j_list: -    M = S[:] -    for i, c in zip(list(range(k - lt, k)), T): -        M[i] = c -    S_tmp = "" -    for i in range(ls): -        if M[i] == "?": -            S_tmp += "a" -        else: -            S_tmp += M[i] -    S_list.append(S_tmp) -S_list.sort() -print((S_list[0])) +        if flg: +            s = S[:i] + T + S[i + tl :] +            ans.append(s.replace("?", "a")) +if ans == []: +    print("UNRESTORABLE") +    exit(0) +ans.sort() +print((ans[0]))