s = eval(input())

t = eval(input())



def f(s, t):

  l = "?"*len(t)

  found = False

  # if l in s:

  #   print('done')

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

    temp = s[len(s)-len(t)-i:len(s)-i]

    count = 0

    for j in range(len(temp)):

      if t[j] == temp[j] or temp[j] == "?":

        count += 1

    if count == len(t):

      s = list(s)

      s[len(s)-len(t)-i:len(s)-i] = t

      for k in range(len(s)):

        if s[k] == "?":

          s[k] = "a"

      return "".join(s)

  return "UNRESTORABLE"

print((f(s, t)))
s = list(eval(input()))

t = eval(input())

ans = False

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

  temp = s[i:i+len(t)]

  count = 0

  for j in range(len(temp)):

    if temp[j] == t[j] or temp[j] == "?":

      count += 1

    else:

      break

  if count == len(t):

    ans = True

    s[i:i+len(t)] = t

    s = "".join(s).replace('?', 'a')

    print(s)

    break



if not ans:

  print('UNRESTORABLE')
s = eval(input())
t = eval(input())


def f(s, t):
    l = "?" * len(t)
    found = False
    # if l in s:
    #   print('done')
    for i in range(len(s) - len(t) + 1):
        temp = s[len(s) - len(t) - i : len(s) - i]
        count = 0
        for j in range(len(temp)):
            if t[j] == temp[j] or temp[j] == "?":
                count += 1
        if count == len(t):
            s = list(s)
            s[len(s) - len(t) - i : len(s) - i] = t
            for k in range(len(s)):
                if s[k] == "?":
                    s[k] = "a"
            return "".join(s)
    return "UNRESTORABLE"


print((f(s, t)))

s = list(eval(input()))
t = eval(input())
ans = False
for i in range(len(s) - len(t), -1, -1):
    temp = s[i : i + len(t)]
    count = 0
    for j in range(len(temp)):
        if temp[j] == t[j] or temp[j] == "?":
            count += 1
        else:
            break
    if count == len(t):
        ans = True
        s[i : i + len(t)] = t
        s = "".join(s).replace("?", "a")
        print(s)
        break
if not ans:
    print("UNRESTORABLE")

-s = eval(input()) +s = list(eval(input())) - - -def f(s, t): -    l = "?" * len(t) -    found = False -    # if l in s: -    #   print('done') -    for i in range(len(s) - len(t) + 1): -        temp = s[len(s) - len(t) - i : len(s) - i] -        count = 0 -        for j in range(len(temp)): -            if t[j] == temp[j] or temp[j] == "?": -                count += 1 -        if count == len(t): -            s = list(s) -            s[len(s) - len(t) - i : len(s) - i] = t -            for k in range(len(s)): -                if s[k] == "?": -                    s[k] = "a" -            return "".join(s) -    return "UNRESTORABLE" - - -print((f(s, t))) +ans = False +for i in range(len(s) - len(t), -1, -1): +    temp = s[i : i + len(t)] +    count = 0 +    for j in range(len(temp)): +        if temp[j] == t[j] or temp[j] == "?": +            count += 1 +        else: +            break +    if count == len(t): +        ans = True +        s[i : i + len(t)] = t +        s = "".join(s).replace("?", "a") +        print(s) +        break +if not ans: +    print("UNRESTORABLE")