S=eval(input())

ls=len(S)

T=eval(input())

lt=len(T)

ans="z"*51

for i in range(ls-lt+1):

  s=S[i:i+lt]

  hamaru=True

  now="z"*51

  for j in range(lt):

    if s[j]!="?" and s[j]!=T[j]:

      hamaru=False

  #print(hamaru)

  if hamaru:

    now=""

    for k in range(ls):

      if k in list(range(i,i+lt)):

        now+=T[k-i]

      elif S[k]=="?":

        now+="a"

      else:

        now+=S[k]

  ans=min(ans,now)

if ans=="z"*51:

  ans="UNRESTORABLE"

print(ans)
S=eval(input())

T=eval(input())



N=len(S)

TN=len(T)

ans="z"*51

if N<TN:

    print("UNRESTORABLE")

    exit()

for i in range(N-TN+1):

    #始点

    ok=True

    for j in range(TN):

        if S[i+j]==T[j] or S[i+j]=="?":

            continue

        else:

            ok=False

            break

    if ok:

        now=S[:i].replace("?", "a")+T+S[i+TN:].replace("?", "a")

        ans=min(now, ans)



if ans=="z"*51:

    ans="UNRESTORABLE"

print(ans)
S = eval(input())
ls = len(S)
T = eval(input())
lt = len(T)
ans = "z" * 51
for i in range(ls - lt + 1):
    s = S[i : i + lt]
    hamaru = True
    now = "z" * 51
    for j in range(lt):
        if s[j] != "?" and s[j] != T[j]:
            hamaru = False
    # print(hamaru)
    if hamaru:
        now = ""
        for k in range(ls):
            if k in list(range(i, i + lt)):
                now += T[k - i]
            elif S[k] == "?":
                now += "a"
            else:
                now += S[k]
    ans = min(ans, now)
if ans == "z" * 51:
    ans = "UNRESTORABLE"
print(ans)

S = eval(input())
T = eval(input())
N = len(S)
TN = len(T)
ans = "z" * 51
if N < TN:
    print("UNRESTORABLE")
    exit()
for i in range(N - TN + 1):
    # 始点
    ok = True
    for j in range(TN):
        if S[i + j] == T[j] or S[i + j] == "?":
            continue
        else:
            ok = False
            break
    if ok:
        now = S[:i].replace("?", "a") + T + S[i + TN :].replace("?", "a")
        ans = min(now, ans)
if ans == "z" * 51:
    ans = "UNRESTORABLE"
print(ans)

-ls = len(S) -lt = len(T) +N = len(S) +TN = len(T) -for i in range(ls - lt + 1): -    s = S[i : i + lt] -    hamaru = True -    now = "z" * 51 -    for j in range(lt): -        if s[j] != "?" and s[j] != T[j]: -            hamaru = False -    # print(hamaru) -    if hamaru: -        now = "" -        for k in range(ls): -            if k in list(range(i, i + lt)): -                now += T[k - i] -            elif S[k] == "?": -                now += "a" -            else: -                now += S[k] -    ans = min(ans, now) +if N < TN: +    print("UNRESTORABLE") +    exit() +for i in range(N - TN + 1): +    # 始点 +    ok = True +    for j in range(TN): +        if S[i + j] == T[j] or S[i + j] == "?": +            continue +        else: +            ok = False +            break +    if ok: +        now = S[:i].replace("?", "a") + T + S[i + TN :].replace("?", "a") +        ans = min(now, ans)