S = input().strip()

N=len(S)

T = input().strip()

M=len(T)

A = []

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

    flag = 0

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

        if S[j]=="?" or S[j]==T[j-i]:continue

        else:

            flag=1

            break

    if flag==0:

        X = list(S)

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

            X[j] = T[j-i]

        for i in range(N):

            if X[i]=="?":

                X[i]="a"

        A.append(X)

if len(A)==0:

    print("UNRESTORABLE")

else:

    A = sorted(A)

    print(("".join(A[0])))
S = input().strip()

N = len(S)

T = input().strip()

K = len(T)

flag = 0

ind = -1

for i in range(N-K,-1,-1):

    A = list(S[i:i+K])

    flag = 0

    for j in range(K):

        if A[j]!="?" and A[j]!=T[j]:

            flag = 1

            break

    if flag == 0:

        ind = i

        break

if ind<0:

    print("UNRESTORABLE")

else:

    S = list(S)

    for j in range(K):

        if S[ind+j]=="?":

            S[ind+j] = T[j]

    for i in range(N):

        if S[i]=="?":

            S[i]="a"

    print(("".join(S)))
S = input().strip()
N = len(S)
T = input().strip()
M = len(T)
A = []
for i in range(N - M + 1):
    flag = 0
    for j in range(i, i + M):
        if S[j] == "?" or S[j] == T[j - i]:
            continue
        else:
            flag = 1
            break
    if flag == 0:
        X = list(S)
        for j in range(i, i + M):
            X[j] = T[j - i]
        for i in range(N):
            if X[i] == "?":
                X[i] = "a"
        A.append(X)
if len(A) == 0:
    print("UNRESTORABLE")
else:
    A = sorted(A)
    print(("".join(A[0])))

S = input().strip()
N = len(S)
T = input().strip()
K = len(T)
flag = 0
ind = -1
for i in range(N - K, -1, -1):
    A = list(S[i : i + K])
    flag = 0
    for j in range(K):
        if A[j] != "?" and A[j] != T[j]:
            flag = 1
            break
    if flag == 0:
        ind = i
        break
if ind < 0:
    print("UNRESTORABLE")
else:
    S = list(S)
    for j in range(K):
        if S[ind + j] == "?":
            S[ind + j] = T[j]
    for i in range(N):
        if S[i] == "?":
            S[i] = "a"
    print(("".join(S)))

-M = len(T) -A = [] -for i in range(N - M + 1): +K = len(T) +flag = 0 +ind = -1 +for i in range(N - K, -1, -1): +    A = list(S[i : i + K]) -    for j in range(i, i + M): -        if S[j] == "?" or S[j] == T[j - i]: -            continue -        else: +    for j in range(K): +        if A[j] != "?" and A[j] != T[j]: -        X = list(S) -        for j in range(i, i + M): -            X[j] = T[j - i] -        for i in range(N): -            if X[i] == "?": -                X[i] = "a" -        A.append(X) -if len(A) == 0: +        ind = i +        break +if ind < 0: -    A = sorted(A) -    print(("".join(A[0]))) +    S = list(S) +    for j in range(K): +        if S[ind + j] == "?": +            S[ind + j] = T[j] +    for i in range(N): +        if S[i] == "?": +            S[i] = "a" +    print(("".join(S)))