S = eval(input())

T = eval(input())



index = []

ss = []

flag = False



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

    for j in range(len(T)):

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

            break

        if j == len(T) - 1:

            flag = True

            index.append(i)



if flag:

    for v in index:

        s = ''

        k = 0

        for i in range(len(S)):

            if v <= i <= v + len(T) - 1:

                s += T[k]

                k += 1

                continue

            if S[i] == '?':

                s += 'a'

            else:

                s += S[i]

        ss.append(s)

    ss.sort()

    s = ss[0]

else:

    s = 'UNRESTORABLE'



print(s)

S = eval(input())

T = eval(input())



flag = False

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

    for j in range(len(T)):

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

            break

        if j == len(T) - 1:

            flag = True

            index = i



if flag:

    s = ''

    k = 0

    for i in range(len(S)):

        if index <= i <= index + len(T) - 1:

            s += T[k]

            k += 1

            continue

        if S[i] == '?':

            s += 'a'

        else:

            s += S[i]

else:

    s = 'UNRESTORABLE'



print(s)

S = eval(input())
T = eval(input())
index = []
ss = []
flag = False
for i in range(len(S) - len(T) + 1):
    for j in range(len(T)):
        if S[i + j] != T[j] and S[i + j] != "?":
            break
        if j == len(T) - 1:
            flag = True
            index.append(i)
if flag:
    for v in index:
        s = ""
        k = 0
        for i in range(len(S)):
            if v <= i <= v + len(T) - 1:
                s += T[k]
                k += 1
                continue
            if S[i] == "?":
                s += "a"
            else:
                s += S[i]
        ss.append(s)
    ss.sort()
    s = ss[0]
else:
    s = "UNRESTORABLE"
print(s)

S = eval(input())
T = eval(input())
flag = False
for i in range(len(S) - len(T) + 1):
    for j in range(len(T)):
        if S[i + j] != T[j] and S[i + j] != "?":
            break
        if j == len(T) - 1:
            flag = True
            index = i
if flag:
    s = ""
    k = 0
    for i in range(len(S)):
        if index <= i <= index + len(T) - 1:
            s += T[k]
            k += 1
            continue
        if S[i] == "?":
            s += "a"
        else:
            s += S[i]
else:
    s = "UNRESTORABLE"
print(s)

-index = [] -ss = [] -            index.append(i) +            index = i -    for v in index: -        s = "" -        k = 0 -        for i in range(len(S)): -            if v <= i <= v + len(T) - 1: -                s += T[k] -                k += 1 -                continue -            if S[i] == "?": -                s += "a" -            else: -                s += S[i] -        ss.append(s) -    ss.sort() -    s = ss[0] +    s = "" +    k = 0 +    for i in range(len(S)): +        if index <= i <= index + len(T) - 1: +            s += T[k] +            k += 1 +            continue +        if S[i] == "?": +            s += "a" +        else: +            s += S[i]