import re





S_ = eval(input())

T = eval(input())



S_ = S_[::-1]

T = T[::-1]



t = ''

for c in T:

    t += '[?' + c + ']'

regex = re.compile(t)



S, cnt = regex.subn(T, S_, count=1)

if cnt:

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

    print((S[::-1]))

else:

    print('UNRESTORABLE')

Sx = eval(input())

T = eval(input())



offset = len(Sx) - len(T)



ans = 'UNRESTORABLE'

if len(Sx) >= len(T):

    for d in range(offset, -1, -1):

        for j in range(len(T)):

            if Sx[d + j] not in ['?', T[j]]:

                break

        else:

            break

    else:

        print('UNRESTORABLE')

        exit()



    ans = ''

    for i in range(len(Sx)):

        if i < d or d + (len(T) - 1) < i:

            c = Sx[i]

        else:

            c = T[i - d]

        c = 'a' if c == '?' else c



        ans += c



print(ans)

import re

S_ = eval(input())
T = eval(input())
S_ = S_[::-1]
T = T[::-1]
t = ""
for c in T:
    t += "[?" + c + "]"
regex = re.compile(t)
S, cnt = regex.subn(T, S_, count=1)
if cnt:
    S = S.replace("?", "a")
    print((S[::-1]))
else:
    print("UNRESTORABLE")

Sx = eval(input())
T = eval(input())
offset = len(Sx) - len(T)
ans = "UNRESTORABLE"
if len(Sx) >= len(T):
    for d in range(offset, -1, -1):
        for j in range(len(T)):
            if Sx[d + j] not in ["?", T[j]]:
                break
        else:
            break
    else:
        print("UNRESTORABLE")
        exit()
    ans = ""
    for i in range(len(Sx)):
        if i < d or d + (len(T) - 1) < i:
            c = Sx[i]
        else:
            c = T[i - d]
        c = "a" if c == "?" else c
        ans += c
print(ans)

-import re - -S_ = eval(input()) +Sx = eval(input()) -S_ = S_[::-1] -T = T[::-1] -t = "" -for c in T: -    t += "[?" + c + "]" -regex = re.compile(t) -S, cnt = regex.subn(T, S_, count=1) -if cnt: -    S = S.replace("?", "a") -    print((S[::-1])) -else: -    print("UNRESTORABLE") +offset = len(Sx) - len(T) +ans = "UNRESTORABLE" +if len(Sx) >= len(T): +    for d in range(offset, -1, -1): +        for j in range(len(T)): +            if Sx[d + j] not in ["?", T[j]]: +                break +        else: +            break +    else: +        print("UNRESTORABLE") +        exit() +    ans = "" +    for i in range(len(Sx)): +        if i < d or d + (len(T) - 1) < i: +            c = Sx[i] +        else: +            c = T[i - d] +        c = "a" if c == "?" else c +        ans += c +print(ans)