s=eval(input())

t=eval(input())

n=len(s)

m=len(t)

ans='UNRESTORABLE'

a=[]

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

  if s[i]==t[0] or s[i]=='?':

    for j in range(m):

      if s[i+j]!=t[j] and s[i+j]!='?':

        break

    else:

      an=list(s[:i]+t+s[i+j+1:])

      for k in range(n):

        if an[k]=='?':

          an[k]='a'

      an=''.join(an)

      a.append(an)

if len(a):

  print((min(a)))

else:print(ans)
s=eval(input())

t=eval(input())

ans=[]

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

  for j in range(len(t)):

    if s[i+j]!=t[j] and s[i+j]!='?':break

  else:

    a=''

    for k in s[0:i]+t+s[i+len(t):]:

      if k=='?':a+='a'

      else:a+=k

    ans+=[a]

ans=sorted(ans)

if ans:print((ans[0]))

else:print('UNRESTORABLE')
s = eval(input())
t = eval(input())
n = len(s)
m = len(t)
ans = "UNRESTORABLE"
a = []
for i in range(n - m + 1):
    if s[i] == t[0] or s[i] == "?":
        for j in range(m):
            if s[i + j] != t[j] and s[i + j] != "?":
                break
        else:
            an = list(s[:i] + t + s[i + j + 1 :])
            for k in range(n):
                if an[k] == "?":
                    an[k] = "a"
            an = "".join(an)
            a.append(an)
if len(a):
    print((min(a)))
else:
    print(ans)

s = eval(input())
t = eval(input())
ans = []
for i in range(len(s) - len(t) + 1):
    for j in range(len(t)):
        if s[i + j] != t[j] and s[i + j] != "?":
            break
    else:
        a = ""
        for k in s[0:i] + t + s[i + len(t) :]:
            if k == "?":
                a += "a"
            else:
                a += k
        ans += [a]
ans = sorted(ans)
if ans:
    print((ans[0]))
else:
    print("UNRESTORABLE")

-n = len(s) -m = len(t) -ans = "UNRESTORABLE" -a = [] -for i in range(n - m + 1): -    if s[i] == t[0] or s[i] == "?": -        for j in range(m): -            if s[i + j] != t[j] and s[i + j] != "?": -                break -        else: -            an = list(s[:i] + t + s[i + j + 1 :]) -            for k in range(n): -                if an[k] == "?": -                    an[k] = "a" -            an = "".join(an) -            a.append(an) -if len(a): -    print((min(a))) +ans = [] +for i in range(len(s) - len(t) + 1): +    for j in range(len(t)): +        if s[i + j] != t[j] and s[i + j] != "?": +            break +    else: +        a = "" +        for k in s[0:i] + t + s[i + len(t) :]: +            if k == "?": +                a += "a" +            else: +                a += k +        ans += [a] +ans = sorted(ans) +if ans: +    print((ans[0])) -    print(ans) +    print("UNRESTORABLE")