import re

S = str(eval(input()))

T = str(eval(input()))

S = S.replace("?",".")



for i in range(len(S)-len(T),-1,-1):

  if re.match(S[i:i+len(T)],T):

    S = S.replace('.','a')

    print((S[:i]+T+S[i+len(T):]))

    exit()



print('UNRESTORABLE')

S = list(eval(input()))

N = len(S)

T = eval(input())

M = len(T)



ans = []



for i in range(N-M+1):

    tmp_S = S[:]

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

        tmp_S[i] = T[0]

        tmp = 1

        for j in range(i+1, i+M):

            if S[j] == "?" or S[j] == T[tmp]:

                tmp_S[i+tmp] = T[tmp]

                tmp += 1

            else:

                break

        tmp_S = "".join(tmp_S)

        if T in tmp_S:

            tmp_S = tmp_S.replace("?", "a")

            ans.append(tmp_S)



if ans:

    ans.sort()

    print((ans[0]))

else:

    print("UNRESTORABLE")

import re

S = str(eval(input()))
T = str(eval(input()))
S = S.replace("?", ".")
for i in range(len(S) - len(T), -1, -1):
    if re.match(S[i : i + len(T)], T):
        S = S.replace(".", "a")
        print((S[:i] + T + S[i + len(T) :]))
        exit()
print("UNRESTORABLE")

S = list(eval(input()))
N = len(S)
T = eval(input())
M = len(T)
ans = []
for i in range(N - M + 1):
    tmp_S = S[:]
    if S[i] == "?" or S[i] == T[0]:
        tmp_S[i] = T[0]
        tmp = 1
        for j in range(i + 1, i + M):
            if S[j] == "?" or S[j] == T[tmp]:
                tmp_S[i + tmp] = T[tmp]
                tmp += 1
            else:
                break
        tmp_S = "".join(tmp_S)
        if T in tmp_S:
            tmp_S = tmp_S.replace("?", "a")
            ans.append(tmp_S)
if ans:
    ans.sort()
    print((ans[0]))
else:
    print("UNRESTORABLE")

-import re - -S = str(eval(input())) -T = str(eval(input())) -S = S.replace("?", ".") -for i in range(len(S) - len(T), -1, -1): -    if re.match(S[i : i + len(T)], T): -        S = S.replace(".", "a") -        print((S[:i] + T + S[i + len(T) :])) -        exit() -print("UNRESTORABLE") +S = list(eval(input())) +N = len(S) +T = eval(input()) +M = len(T) +ans = [] +for i in range(N - M + 1): +    tmp_S = S[:] +    if S[i] == "?" or S[i] == T[0]: +        tmp_S[i] = T[0] +        tmp = 1 +        for j in range(i + 1, i + M): +            if S[j] == "?" or S[j] == T[tmp]: +                tmp_S[i + tmp] = T[tmp] +                tmp += 1 +            else: +                break +        tmp_S = "".join(tmp_S) +        if T in tmp_S: +            tmp_S = tmp_S.replace("?", "a") +            ans.append(tmp_S) +if ans: +    ans.sort() +    print((ans[0])) +else: +    print("UNRESTORABLE")