

s = list(eval(input()))

t = list(eval(input()))

sn = len(s)

tn = len(t)

bag = []



for i in range(sn-tn+1):

  flag = True

  for j in range(tn):

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

      pass 

    else:

      flag = False 



  if flag:

    bag += [i]





if len(bag) == 0:

  print('UNRESTORABLE')

  exit()





def fill(ss, idx):

  for i in range(tn):

    ss[idx+i] = t[i]

  for i in range(sn):

    if ss[i] == '?':

      ss[i] = 'a'



  return ''.join(ss)



s_list = []

for idx in bag:

  ss = s[:]

  s_list += [str(fill(ss, idx))]



s_list.sort()

print((s_list[0]))
S = list(eval(input()))

T = list(eval(input()))

ans_list = []

for i in range(len(S)):

  flag = True

  if S[i] == "?" or S[i] == T[0]:

    tmp = S[i:i+len(T)]

    if len(tmp) != len(T):

      continue

    for j in range(len(T)):

      if tmp[j] != '?' and T[j] != tmp[j]:

        flag = False

        break

    if flag:

      ans = S[:i] + T + S[i+len(T):]

      for i in range(len(ans)):

        if ans[i] == '?':

          ans[i] = 'a'

      ans_list += [ans]



if len(ans_list) != 0:

  ans_list = sorted(ans_list)

  print((''.join(ans_list[0])))

else:

  print('UNRESTORABLE')



s = list(eval(input()))
t = list(eval(input()))
sn = len(s)
tn = len(t)
bag = []
for i in range(sn - tn + 1):
    flag = True
    for j in range(tn):
        if s[i + j] == "?" or s[i + j] == t[j]:
            pass
        else:
            flag = False
    if flag:
        bag += [i]
if len(bag) == 0:
    print("UNRESTORABLE")
    exit()


def fill(ss, idx):
    for i in range(tn):
        ss[idx + i] = t[i]
    for i in range(sn):
        if ss[i] == "?":
            ss[i] = "a"
    return "".join(ss)


s_list = []
for idx in bag:
    ss = s[:]
    s_list += [str(fill(ss, idx))]
s_list.sort()
print((s_list[0]))

S = list(eval(input()))
T = list(eval(input()))
ans_list = []
for i in range(len(S)):
    flag = True
    if S[i] == "?" or S[i] == T[0]:
        tmp = S[i : i + len(T)]
        if len(tmp) != len(T):
            continue
        for j in range(len(T)):
            if tmp[j] != "?" and T[j] != tmp[j]:
                flag = False
                break
        if flag:
            ans = S[:i] + T + S[i + len(T) :]
            for i in range(len(ans)):
                if ans[i] == "?":
                    ans[i] = "a"
            ans_list += [ans]
if len(ans_list) != 0:
    ans_list = sorted(ans_list)
    print(("".join(ans_list[0])))
else:
    print("UNRESTORABLE")

-s = list(eval(input())) -t = list(eval(input())) -sn = len(s) -tn = len(t) -bag = [] -for i in range(sn - tn + 1): +S = list(eval(input())) +T = list(eval(input())) +ans_list = [] +for i in range(len(S)): -    for j in range(tn): -        if s[i + j] == "?" or s[i + j] == t[j]: -            pass -        else: -            flag = False -    if flag: -        bag += [i] -if len(bag) == 0: +    if S[i] == "?" or S[i] == T[0]: +        tmp = S[i : i + len(T)] +        if len(tmp) != len(T): +            continue +        for j in range(len(T)): +            if tmp[j] != "?" and T[j] != tmp[j]: +                flag = False +                break +        if flag: +            ans = S[:i] + T + S[i + len(T) :] +            for i in range(len(ans)): +                if ans[i] == "?": +                    ans[i] = "a" +            ans_list += [ans] +if len(ans_list) != 0: +    ans_list = sorted(ans_list) +    print(("".join(ans_list[0]))) +else: -    exit() - - -def fill(ss, idx): -    for i in range(tn): -        ss[idx + i] = t[i] -    for i in range(sn): -        if ss[i] == "?": -            ss[i] = "a" -    return "".join(ss) - - -s_list = [] -for idx in bag: -    ss = s[:] -    s_list += [str(fill(ss, idx))] -s_list.sort() -print((s_list[0]))