S1 = list(input().strip())

T = list(input().strip())

n = len(S1)

k = len(T)

G = []

for i in range(n-k+1):

    flag = 0

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

        if S1[j]!="?" and S1[j]!=T[j-i]:

            flag = 1

            break

    if flag==0:

        A = S1[:]

        A[i:i+k] = T[:]

        for j in range(n):

            if A[j]=="?":

                A[j] = "a"

        G.append(A)

G = sorted(G)

if len(G)>0:

    print(("".join(G[0])))

else:

    print("UNRESTORABLE")
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])))
S1 = list(input().strip())
T = list(input().strip())
n = len(S1)
k = len(T)
G = []
for i in range(n - k + 1):
    flag = 0
    for j in range(i, i + k):
        if S1[j] != "?" and S1[j] != T[j - i]:
            flag = 1
            break
    if flag == 0:
        A = S1[:]
        A[i : i + k] = T[:]
        for j in range(n):
            if A[j] == "?":
                A[j] = "a"
        G.append(A)
G = sorted(G)
if len(G) > 0:
    print(("".join(G[0])))
else:
    print("UNRESTORABLE")

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])))

-S1 = list(input().strip()) -T = list(input().strip()) -n = len(S1) -k = len(T) -G = [] -for i in range(n - k + 1): +S = input().strip() +N = len(S) +T = input().strip() +M = len(T) +A = [] +for i in range(N - M + 1): -    for j in range(i, i + k): -        if S1[j] != "?" and S1[j] != T[j - i]: +    for j in range(i, i + M): +        if S[j] == "?" or S[j] == T[j - i]: +            continue +        else: -        A = S1[:] -        A[i : i + k] = T[:] -        for j in range(n): -            if A[j] == "?": -                A[j] = "a" -        G.append(A) -G = sorted(G) -if len(G) > 0: -    print(("".join(G[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") -    print("UNRESTORABLE") +    A = sorted(A) +    print(("".join(A[0])))