def is_matched(i, inputS, T):

  for s,t in zip(inputS, T):

    if s == '?': continue

    if s != t: return False

  return True



S, T = eval(input()), eval(input())

lenS, lenT = len(S), len(T)

matched_i = None

for i in range(lenS-lenT+1):

  if is_matched(i, S[i:i+lenT], T):

    matched_i = i

if matched_i is None: print('UNRESTORABLE')

else: print((''.join([s for s in S[:matched_i] + T + S[matched_i+lenT:]]).replace('?', 'a')))

S = eval(input())

T = eval(input())

lenS = len(S)

lenT = len(T)



for i in range(lenS - lenT, -1, -1):

    flag = True

    for ii in range(lenT):

        if S[i+ii] == '?' or S[i+ii] == T[ii]:

            continue

        else:

            flag = False

            break

    if flag == True:

        print(((S[:i] + T + S[i + lenT:]).replace('?', 'a')))

        exit()

print('UNRESTORABLE')

def is_matched(i, inputS, T):
    for s, t in zip(inputS, T):
        if s == "?":
            continue
        if s != t:
            return False
    return True


S, T = eval(input()), eval(input())
lenS, lenT = len(S), len(T)
matched_i = None
for i in range(lenS - lenT + 1):
    if is_matched(i, S[i : i + lenT], T):
        matched_i = i
if matched_i is None:
    print("UNRESTORABLE")
else:
    print(
        (
            "".join([s for s in S[:matched_i] + T + S[matched_i + lenT :]]).replace(
                "?", "a"
            )
        )
    )

S = eval(input())
T = eval(input())
lenS = len(S)
lenT = len(T)
for i in range(lenS - lenT, -1, -1):
    flag = True
    for ii in range(lenT):
        if S[i + ii] == "?" or S[i + ii] == T[ii]:
            continue
        else:
            flag = False
            break
    if flag == True:
        print(((S[:i] + T + S[i + lenT :]).replace("?", "a")))
        exit()
print("UNRESTORABLE")

-def is_matched(i, inputS, T): -    for s, t in zip(inputS, T): -        if s == "?": +S = eval(input()) +T = eval(input()) +lenS = len(S) +lenT = len(T) +for i in range(lenS - lenT, -1, -1): +    flag = True +    for ii in range(lenT): +        if S[i + ii] == "?" or S[i + ii] == T[ii]: -        if s != t: -            return False -    return True - - -S, T = eval(input()), eval(input()) -lenS, lenT = len(S), len(T) -matched_i = None -for i in range(lenS - lenT + 1): -    if is_matched(i, S[i : i + lenT], T): -        matched_i = i -if matched_i is None: -    print("UNRESTORABLE") -else: -    print( -        ( -            "".join([s for s in S[:matched_i] + T + S[matched_i + lenT :]]).replace( -                "?", "a" -            ) -        ) -    ) +        else: +            flag = False +            break +    if flag == True: +        print(((S[:i] + T + S[i + lenT :]).replace("?", "a"))) +        exit() +print("UNRESTORABLE")