from re import*

s,t=open(0)

t=t[:-1]

u=''.join('(%s|\?)'%t for t in t)

a=[]

j=len(t)

for i in range(len(s)-j):

  if match(u,s[i:i+j]):

    a.append(sub('\?','a',s[:i])+t+sub('\?','a',s[i+j:]))

print((min(a or['UNRESTORABLE'])))
s,t=open(0)

m=len(t:=t[:-1])

for i in range(len(s)):

 if all(c in'?'+d for c,d in zip(s[-i-m:],t)):s=s.replace(*'?a');exit(print(s[:-i-m]+t+s[-i:]))

print('UNRESTORABLE')

from re import *

s, t = open(0)
t = t[:-1]
u = "".join("(%s|\?)" % t for t in t)
a = []
j = len(t)
for i in range(len(s) - j):
    if match(u, s[i : i + j]):
        a.append(sub("\?", "a", s[:i]) + t + sub("\?", "a", s[i + j :]))
print((min(a or ["UNRESTORABLE"])))

s, t = open(0)
m = len(t := t[:-1])
for i in range(len(s)):
    if all(c in "?" + d for c, d in zip(s[-i - m :], t)):
        s = s.replace(*"?a")
        exit(print(s[: -i - m] + t + s[-i:]))
print("UNRESTORABLE")

-from re import * - -t = t[:-1] -u = "".join("(%s|\?)" % t for t in t) -a = [] -j = len(t) -for i in range(len(s) - j): -    if match(u, s[i : i + j]): -        a.append(sub("\?", "a", s[:i]) + t + sub("\?", "a", s[i + j :])) -print((min(a or ["UNRESTORABLE"]))) +m = len(t := t[:-1]) +for i in range(len(s)): +    if all(c in "?" + d for c, d in zip(s[-i - m :], t)): +        s = s.replace(*"?a") +        exit(print(s[: -i - m] + t + s[-i:])) +print("UNRESTORABLE")