#!/usr/bin/env python3

s = eval(input())

t = eval(input())

n = len(t)

m = len(s)

c = "z" * m

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

    if all(j in (t[k], "?") for k, j in enumerate(s[i:n + i])):

        c = min(c, s[:i] + t + s[i + n:])

print(("UNRESTORABLE" if c == "z" * m else c.replace("?", "a")))

S = eval(input())

T = eval(input())

s, t = len(S), len(T)

c = "z" * s

for i in range(s - t + 1):

    if all(S[i + j] in (T[j], "?") for j in range(t)):

        c = min(c, S[:i] + T + S[i + t:])

print(("UNRESTORABLE" if c == "z" * s else c.replace("?", "a")))

#!/usr/bin/env python3
s = eval(input())
t = eval(input())
n = len(t)
m = len(s)
c = "z" * m
for i in range(m - n + 1):
    if all(j in (t[k], "?") for k, j in enumerate(s[i : n + i])):
        c = min(c, s[:i] + t + s[i + n :])
print(("UNRESTORABLE" if c == "z" * m else c.replace("?", "a")))

S = eval(input())
T = eval(input())
s, t = len(S), len(T)
c = "z" * s
for i in range(s - t + 1):
    if all(S[i + j] in (T[j], "?") for j in range(t)):
        c = min(c, S[:i] + T + S[i + t :])
print(("UNRESTORABLE" if c == "z" * s else c.replace("?", "a")))

-#!/usr/bin/env python3 -s = eval(input()) -t = eval(input()) -n = len(t) -m = len(s) -c = "z" * m -for i in range(m - n + 1): -    if all(j in (t[k], "?") for k, j in enumerate(s[i : n + i])): -        c = min(c, s[:i] + t + s[i + n :]) -print(("UNRESTORABLE" if c == "z" * m else c.replace("?", "a"))) +S = eval(input()) +T = eval(input()) +s, t = len(S), len(T) +c = "z" * s +for i in range(s - t + 1): +    if all(S[i + j] in (T[j], "?") for j in range(t)): +        c = min(c, S[:i] + T + S[i + t :]) +print(("UNRESTORABLE" if c == "z" * s else c.replace("?", "a")))