def check(p, s):

    flg = True

    for i in range(len(tmp)):

        if s[i]=='?' or p[i]=='?':

            continue

        elif s[i] == p[i]:

            continue

        elif s[i] != p[i]:

            flg = False

    return flg





S = eval(input())

T = eval(input())

lst = []



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

    tmp = S[:i]+T+S[i+len(T):]

    if check(tmp, S):

        lst.append(tmp)



if len(lst)==0:

    ans = 'UNRESTORABLE'

else:

    ans_lst = []

    for x in lst:

        ans_lst.append(x.replace('?','a'))

    ans = min(ans_lst)

print(ans)
s = eval(input())

t = eval(input())

ans = []

for i in range(len(s)-len(t)+1):

    tmp = s[i:i+len(t)]

    flg = True

    for j in range(len(t)):

        if tmp[j]!=t[j]:

            if tmp[j]!='?':

                flg = False

    if flg:

        c = s[:i]+t+s[i+len(t):]

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

print(('UNRESTORABLE' if len(ans)==0 else min(ans)))
def check(p, s):
    flg = True
    for i in range(len(tmp)):
        if s[i] == "?" or p[i] == "?":
            continue
        elif s[i] == p[i]:
            continue
        elif s[i] != p[i]:
            flg = False
    return flg


S = eval(input())
T = eval(input())
lst = []
for i in range(len(S) - len(T) + 1):
    tmp = S[:i] + T + S[i + len(T) :]
    if check(tmp, S):
        lst.append(tmp)
if len(lst) == 0:
    ans = "UNRESTORABLE"
else:
    ans_lst = []
    for x in lst:
        ans_lst.append(x.replace("?", "a"))
    ans = min(ans_lst)
print(ans)

s = eval(input())
t = eval(input())
ans = []
for i in range(len(s) - len(t) + 1):
    tmp = s[i : i + len(t)]
    flg = True
    for j in range(len(t)):
        if tmp[j] != t[j]:
            if tmp[j] != "?":
                flg = False
    if flg:
        c = s[:i] + t + s[i + len(t) :]
        ans.append(c.replace("?", "a"))
print(("UNRESTORABLE" if len(ans) == 0 else min(ans)))

-def check(p, s): +s = eval(input()) +t = eval(input()) +ans = [] +for i in range(len(s) - len(t) + 1): +    tmp = s[i : i + len(t)] -    for i in range(len(tmp)): -        if s[i] == "?" or p[i] == "?": -            continue -        elif s[i] == p[i]: -            continue -        elif s[i] != p[i]: -            flg = False -    return flg - - -S = eval(input()) -T = eval(input()) -lst = [] -for i in range(len(S) - len(T) + 1): -    tmp = S[:i] + T + S[i + len(T) :] -    if check(tmp, S): -        lst.append(tmp) -if len(lst) == 0: -    ans = "UNRESTORABLE" -else: -    ans_lst = [] -    for x in lst: -        ans_lst.append(x.replace("?", "a")) -    ans = min(ans_lst) -print(ans) +    for j in range(len(t)): +        if tmp[j] != t[j]: +            if tmp[j] != "?": +                flg = False +    if flg: +        c = s[:i] + t + s[i + len(t) :] +        ans.append(c.replace("?", "a")) +print(("UNRESTORABLE" if len(ans) == 0 else min(ans)))