import copy



s = eval(input())

t = eval(input())

n = len(t)



ans = set()

flg = False

for i in range(len(s)):

    tmp = s[i: i + n]

    for j in range(n):

        try:

            if tmp[j] != "?" and tmp[j] != t[j]:

                flg = False

                break

            else:

                flg = True

        except IndexError:

            flg = False

            break

    if flg:

        if len(ans) > 0:

            ans.clear()

        s_1_l = list(copy.deepcopy(s))

        for k in range(len(s_1_l)):

            if s_1_l[k] == "?":

                s_1_l[k] = "a"

        s_1_l[i: i + n] = t

        ans.add("".join(s_1_l))



if len(ans) == 0:

    print("UNRESTORABLE")

else:

    print((*ans))

import sys



sys.setrecursionlimit(10 ** 7)

f_inf = float('inf')

mod = 10 ** 9 + 7





def resolve():

    s = eval(input())

    t = eval(input())

    n = len(s)



    res = []

    for i in range(n):

        ss = list(s)

        if (s[i] == t[0] or s[i] == "?") and i + len(t) <= n:

            pos = 0

            for j in range(i, i + len(t)):

                if s[j] != "?" and s[j] != t[pos]:

                    break

                pos += 1

            else:

                pos = 0

                for j in range(i, i + len(t)):

                    ss[j] = t[pos]

                    pos += 1

                ss = "".join(ss).replace("?", "a")

                res.append(ss)



    if len(res) == 0:

        print("UNRESTORABLE")

    else:

        res = sorted(res)

        print((res[0]))





if __name__ == '__main__':

    resolve()

import copy

s = eval(input())
t = eval(input())
n = len(t)
ans = set()
flg = False
for i in range(len(s)):
    tmp = s[i : i + n]
    for j in range(n):
        try:
            if tmp[j] != "?" and tmp[j] != t[j]:
                flg = False
                break
            else:
                flg = True
        except IndexError:
            flg = False
            break
    if flg:
        if len(ans) > 0:
            ans.clear()
        s_1_l = list(copy.deepcopy(s))
        for k in range(len(s_1_l)):
            if s_1_l[k] == "?":
                s_1_l[k] = "a"
        s_1_l[i : i + n] = t
        ans.add("".join(s_1_l))
if len(ans) == 0:
    print("UNRESTORABLE")
else:
    print((*ans))

import sys

sys.setrecursionlimit(10**7)
f_inf = float("inf")
mod = 10**9 + 7


def resolve():
    s = eval(input())
    t = eval(input())
    n = len(s)
    res = []
    for i in range(n):
        ss = list(s)
        if (s[i] == t[0] or s[i] == "?") and i + len(t) <= n:
            pos = 0
            for j in range(i, i + len(t)):
                if s[j] != "?" and s[j] != t[pos]:
                    break
                pos += 1
            else:
                pos = 0
                for j in range(i, i + len(t)):
                    ss[j] = t[pos]
                    pos += 1
                ss = "".join(ss).replace("?", "a")
                res.append(ss)
    if len(res) == 0:
        print("UNRESTORABLE")
    else:
        res = sorted(res)
        print((res[0]))


if __name__ == "__main__":
    resolve()

-import copy +import sys -s = eval(input()) -t = eval(input()) -n = len(t) -ans = set() -flg = False -for i in range(len(s)): -    tmp = s[i : i + n] -    for j in range(n): -        try: -            if tmp[j] != "?" and tmp[j] != t[j]: -                flg = False -                break +sys.setrecursionlimit(10**7) +f_inf = float("inf") +mod = 10**9 + 7 + + +def resolve(): +    s = eval(input()) +    t = eval(input()) +    n = len(s) +    res = [] +    for i in range(n): +        ss = list(s) +        if (s[i] == t[0] or s[i] == "?") and i + len(t) <= n: +            pos = 0 +            for j in range(i, i + len(t)): +                if s[j] != "?" and s[j] != t[pos]: +                    break +                pos += 1 -                flg = True -        except IndexError: -            flg = False -            break -    if flg: -        if len(ans) > 0: -            ans.clear() -        s_1_l = list(copy.deepcopy(s)) -        for k in range(len(s_1_l)): -            if s_1_l[k] == "?": -                s_1_l[k] = "a" -        s_1_l[i : i + n] = t -        ans.add("".join(s_1_l)) -if len(ans) == 0: -    print("UNRESTORABLE") -else: -    print((*ans)) +                pos = 0 +                for j in range(i, i + len(t)): +                    ss[j] = t[pos] +                    pos += 1 +                ss = "".join(ss).replace("?", "a") +                res.append(ss) +    if len(res) == 0: +        print("UNRESTORABLE") +    else: +        res = sorted(res) +        print((res[0])) + + +if __name__ == "__main__": +    resolve()