def main():

    s = eval(input())

    t = eval(input())

    s_len = len(s)

    t_len = len(t)

    def t_check(t_true,t_can):

            for tt,tc in zip(t_true,t_can):

                if tc != '?' and tt != tc:

                    return False

            else:

                return True



    if s_len < t_len:

        print('UNRESTORABLE')

    elif s_len == t_len:

        if t_check(t,s):

            print(t)

        else:

            print('UNRESTORABLE')

    else:

        ans = ""

        for i in range(s_len - t_len + 1)[::-1]:

            if t_check(t,s[i:i+t_len]):

                ans = s[:i] + t + s[i+t_len:]

                ans = ans.replace('?','a')

                print(ans)

                break

        else:

            print('UNRESTORABLE')

if __name__ == "__main__":

    main()
def main():

    S = input()

    T = input()

    N = len(S)

    M = len(T)

    ans = ""

    for i, s in enumerate(S[::-1]):

        cur = S[-(M+i):-i] if i != 0 else S[(-(M+i)):]

        if len(cur) == M:

            pass

        else:

            continue

        if (s == T[-1] or s == "?") and \

                all(ss == "?" or ss == t for ss, t in zip(cur, T)):

            if i != 0:

                ans = S[:-(M+i)] + T + S[-i:]

            else:

                ans = S[:-(M+i)] + T

            break

    if ans:

        ans = ans.replace("?", "a")

        print(ans)

    else:

        print("UNRESTORABLE")





if __name__ == '__main__':

    main()

def main():
    s = eval(input())
    t = eval(input())
    s_len = len(s)
    t_len = len(t)

    def t_check(t_true, t_can):
        for tt, tc in zip(t_true, t_can):
            if tc != "?" and tt != tc:
                return False
        else:
            return True

    if s_len < t_len:
        print("UNRESTORABLE")
    elif s_len == t_len:
        if t_check(t, s):
            print(t)
        else:
            print("UNRESTORABLE")
    else:
        ans = ""
        for i in range(s_len - t_len + 1)[::-1]:
            if t_check(t, s[i : i + t_len]):
                ans = s[:i] + t + s[i + t_len :]
                ans = ans.replace("?", "a")
                print(ans)
                break
        else:
            print("UNRESTORABLE")


if __name__ == "__main__":
    main()

def main():
    S = input()
    T = input()
    N = len(S)
    M = len(T)
    ans = ""
    for i, s in enumerate(S[::-1]):
        cur = S[-(M + i) : -i] if i != 0 else S[(-(M + i)) :]
        if len(cur) == M:
            pass
        else:
            continue
        if (s == T[-1] or s == "?") and all(
            ss == "?" or ss == t for ss, t in zip(cur, T)
        ):
            if i != 0:
                ans = S[: -(M + i)] + T + S[-i:]
            else:
                ans = S[: -(M + i)] + T
            break
    if ans:
        ans = ans.replace("?", "a")
        print(ans)
    else:
        print("UNRESTORABLE")


if __name__ == "__main__":
    main()

-    s = eval(input()) -    t = eval(input()) -    s_len = len(s) -    t_len = len(t) - -    def t_check(t_true, t_can): -        for tt, tc in zip(t_true, t_can): -            if tc != "?" and tt != tc: -                return False +    S = input() +    T = input() +    N = len(S) +    M = len(T) +    ans = "" +    for i, s in enumerate(S[::-1]): +        cur = S[-(M + i) : -i] if i != 0 else S[(-(M + i)) :] +        if len(cur) == M: +            pass -            return True - -    if s_len < t_len: +            continue +        if (s == T[-1] or s == "?") and all( +            ss == "?" or ss == t for ss, t in zip(cur, T) +        ): +            if i != 0: +                ans = S[: -(M + i)] + T + S[-i:] +            else: +                ans = S[: -(M + i)] + T +            break +    if ans: +        ans = ans.replace("?", "a") +        print(ans) +    else: -    elif s_len == t_len: -        if t_check(t, s): -            print(t) -        else: -            print("UNRESTORABLE") -    else: -        ans = "" -        for i in range(s_len - t_len + 1)[::-1]: -            if t_check(t, s[i : i + t_len]): -                ans = s[:i] + t + s[i + t_len :] -                ans = ans.replace("?", "a") -                print(ans) -                break -        else: -            print("UNRESTORABLE")