import re

 

def solve(s, t):

    s = s.replace('?', '.')

    ls, lt = len(s), len(t)

    if ls < lt:

        return 'UNRESTORABLE'

    ans = []

    

    for i in range(ls - lt + 1):

        m = re.match(s[i:i+lt], t)

        if m is None:

            continue

        ans.append( (s[:i] + t + s[i+lt:]).replace('.', 'a') )

        

    if not ans:

        return 'UNRESTORABLE'

    

    return min(ans)

 

S = eval(input())

T = eval(input())

 

print((solve(S, T)))
Sd = eval(input())

T = eval(input())



def check(A, B):

    for a, b in zip(A, B):

        if a != '?' and a != b:

            return False

    return True



for i in range(len(Sd) - len(T) + 1)[::-1]:

    if check(Sd[i:i + len(T)], T):

        print(((Sd[:i] + T + Sd[i + len(T):]).replace('?', 'a')))

        break

else:

    print('UNRESTORABLE')
import re


def solve(s, t):
    s = s.replace("?", ".")
    ls, lt = len(s), len(t)
    if ls < lt:
        return "UNRESTORABLE"
    ans = []
    for i in range(ls - lt + 1):
        m = re.match(s[i : i + lt], t)
        if m is None:
            continue
        ans.append((s[:i] + t + s[i + lt :]).replace(".", "a"))
    if not ans:
        return "UNRESTORABLE"
    return min(ans)


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

Sd = eval(input())
T = eval(input())


def check(A, B):
    for a, b in zip(A, B):
        if a != "?" and a != b:
            return False
    return True


for i in range(len(Sd) - len(T) + 1)[::-1]:
    if check(Sd[i : i + len(T)], T):
        print(((Sd[:i] + T + Sd[i + len(T) :]).replace("?", "a")))
        break
else:
    print("UNRESTORABLE")

-import re +Sd = eval(input()) +T = eval(input()) -def solve(s, t): -    s = s.replace("?", ".") -    ls, lt = len(s), len(t) -    if ls < lt: -        return "UNRESTORABLE" -    ans = [] -    for i in range(ls - lt + 1): -        m = re.match(s[i : i + lt], t) -        if m is None: -            continue -        ans.append((s[:i] + t + s[i + lt :]).replace(".", "a")) -    if not ans: -        return "UNRESTORABLE" -    return min(ans) +def check(A, B): +    for a, b in zip(A, B): +        if a != "?" and a != b: +            return False +    return True -S = eval(input()) -T = eval(input()) -print((solve(S, T))) +for i in range(len(Sd) - len(T) + 1)[::-1]: +    if check(Sd[i : i + len(T)], T): +        print(((Sd[:i] + T + Sd[i + len(T) :]).replace("?", "a"))) +        break +else: +    print("UNRESTORABLE")