s = eval(input())

t = eval(input())



flag = 0

count = 0

new = ''

l = []

for i in range(len(s)):

    if s[i] == '?' or s[i] in t:

        if count == 0:

            start = i

        count += 1

    else:

        if count >= len(t):

            for j in range(count-len(t)+1):

                check = 0

                for k in range(len(t)):

                    if s[start+j+k] != t[k] and s[start+j+k] != '?':

                        check = 1

                        break

                if check == 0:

                    new = s[:start+j] + t + s[start+len(t)+j:]

                    l.append(new)

                    flag = 1

        count = 0



if count >= len(t):

    for j in range(count-len(t)+1):

        check = 0

        for k in range(len(t)):

            if s[start+j+k] != t[k] and s[start+j+k] != '?':

                check = 1

                break

        if check == 0:

            new = s[:start+j] + t + s[start+len(t)+j:]

            l.append(new)

            flag = 1



if flag == 0:

    print('UNRESTORABLE')

else:

    ans = []

    for n in l:

        for i in range(len(n)):

            if n[i] == '?':

                n = n[:i] + 'a' + n[i+1:]

        ans.append(n)

    print((sorted(ans)[0]))

s = eval(input())

t = eval(input())

ans = ''

if len(s) >= len(t):

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

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

        flag = 0

        for j in range(len(t)):

            if s_tmp[j] == '?':

                s_tmp = t[:j+1] + s_tmp[j+1:]

            elif s_tmp[j] != t[j]:

                flag = 1

                break

        if flag == 0:

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

            break

else:

    flag = 1



if flag == 0:

    for i in range(len(ans)):

        if ans[i] == '?':

            ans = ans[:i] + 'a' + ans[i+1:]

    print(ans)

else:

    print('UNRESTORABLE')

s = eval(input())
t = eval(input())
flag = 0
count = 0
new = ""
l = []
for i in range(len(s)):
    if s[i] == "?" or s[i] in t:
        if count == 0:
            start = i
        count += 1
    else:
        if count >= len(t):
            for j in range(count - len(t) + 1):
                check = 0
                for k in range(len(t)):
                    if s[start + j + k] != t[k] and s[start + j + k] != "?":
                        check = 1
                        break
                if check == 0:
                    new = s[: start + j] + t + s[start + len(t) + j :]
                    l.append(new)
                    flag = 1
        count = 0
if count >= len(t):
    for j in range(count - len(t) + 1):
        check = 0
        for k in range(len(t)):
            if s[start + j + k] != t[k] and s[start + j + k] != "?":
                check = 1
                break
        if check == 0:
            new = s[: start + j] + t + s[start + len(t) + j :]
            l.append(new)
            flag = 1
if flag == 0:
    print("UNRESTORABLE")
else:
    ans = []
    for n in l:
        for i in range(len(n)):
            if n[i] == "?":
                n = n[:i] + "a" + n[i + 1 :]
        ans.append(n)
    print((sorted(ans)[0]))

s = eval(input())
t = eval(input())
ans = ""
if len(s) >= len(t):
    for i in range(len(s) - len(t), -1, -1):
        s_tmp = s[i : i + len(t)]
        flag = 0
        for j in range(len(t)):
            if s_tmp[j] == "?":
                s_tmp = t[: j + 1] + s_tmp[j + 1 :]
            elif s_tmp[j] != t[j]:
                flag = 1
                break
        if flag == 0:
            ans = s[:i] + t + s[i + len(t) :]
            break
else:
    flag = 1
if flag == 0:
    for i in range(len(ans)):
        if ans[i] == "?":
            ans = ans[:i] + "a" + ans[i + 1 :]
    print(ans)
else:
    print("UNRESTORABLE")

-flag = 0 -count = 0 -new = "" -l = [] -for i in range(len(s)): -    if s[i] == "?" or s[i] in t: -        if count == 0: -            start = i -        count += 1 -    else: -        if count >= len(t): -            for j in range(count - len(t) + 1): -                check = 0 -                for k in range(len(t)): -                    if s[start + j + k] != t[k] and s[start + j + k] != "?": -                        check = 1 -                        break -                if check == 0: -                    new = s[: start + j] + t + s[start + len(t) + j :] -                    l.append(new) -                    flag = 1 -        count = 0 -if count >= len(t): -    for j in range(count - len(t) + 1): -        check = 0 -        for k in range(len(t)): -            if s[start + j + k] != t[k] and s[start + j + k] != "?": -                check = 1 +ans = "" +if len(s) >= len(t): +    for i in range(len(s) - len(t), -1, -1): +        s_tmp = s[i : i + len(t)] +        flag = 0 +        for j in range(len(t)): +            if s_tmp[j] == "?": +                s_tmp = t[: j + 1] + s_tmp[j + 1 :] +            elif s_tmp[j] != t[j]: +                flag = 1 -        if check == 0: -            new = s[: start + j] + t + s[start + len(t) + j :] -            l.append(new) -            flag = 1 +        if flag == 0: +            ans = s[:i] + t + s[i + len(t) :] +            break +else: +    flag = 1 +    for i in range(len(ans)): +        if ans[i] == "?": +            ans = ans[:i] + "a" + ans[i + 1 :] +    print(ans) +else: -else: -    ans = [] -    for n in l: -        for i in range(len(n)): -            if n[i] == "?": -                n = n[:i] + "a" + n[i + 1 :] -        ans.append(n) -    print((sorted(ans)[0]))