s_ = eval(input())

t = eval(input())



exit_flag = True

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

    flag = True

    for j in range(len(t)):

        if (s_[i+j] != '?') and (s_[i+j] != t[j]):

            flag = False

    

    if flag:

        h = ''

        for index in range(len(s_)):

            if (i <= index <= i + len(t) -1):

                h += t[index - i]

            else:

                h += s_[index]

        exit_flag = False



if exit_flag:

    print('UNRESTORABLE')

    exit()



h = h.replace('?', 'a')

print(h)

# C

sd = eval(input())

scnt = len(sd)

t = eval(input())

tcnt = len(t)



point = 0

unrestorable = True

while point <= scnt - tcnt:

    oneroopcorres = True

    for i in range(tcnt):

        anyone = sd[point+i] == '?'

        correspond = sd[point+i] == t[i]

        if not (anyone or correspond):

            oneroopcorres = False



    if oneroopcorres:

        unrestorable = False

        good_point = point



    point += 1



if unrestorable:

    print('UNRESTORABLE')

    exit()

else:

    sd = list(sd)

    for i in range(tcnt):

        sd[good_point + i] = t[i]

    sd = ''.join(sd)



sd = sd.replace('?', 'a')

print(sd)
s_ = eval(input())
t = eval(input())
exit_flag = True
for i in range(len(s_) - len(t) + 1):
    flag = True
    for j in range(len(t)):
        if (s_[i + j] != "?") and (s_[i + j] != t[j]):
            flag = False
    if flag:
        h = ""
        for index in range(len(s_)):
            if i <= index <= i + len(t) - 1:
                h += t[index - i]
            else:
                h += s_[index]
        exit_flag = False
if exit_flag:
    print("UNRESTORABLE")
    exit()
h = h.replace("?", "a")
print(h)

# C
sd = eval(input())
scnt = len(sd)
t = eval(input())
tcnt = len(t)
point = 0
unrestorable = True
while point <= scnt - tcnt:
    oneroopcorres = True
    for i in range(tcnt):
        anyone = sd[point + i] == "?"
        correspond = sd[point + i] == t[i]
        if not (anyone or correspond):
            oneroopcorres = False
    if oneroopcorres:
        unrestorable = False
        good_point = point
    point += 1
if unrestorable:
    print("UNRESTORABLE")
    exit()
else:
    sd = list(sd)
    for i in range(tcnt):
        sd[good_point + i] = t[i]
    sd = "".join(sd)
sd = sd.replace("?", "a")
print(sd)

-s_ = eval(input()) +# C +sd = eval(input()) +scnt = len(sd) -exit_flag = True -for i in range(len(s_) - len(t) + 1): -    flag = True -    for j in range(len(t)): -        if (s_[i + j] != "?") and (s_[i + j] != t[j]): -            flag = False -    if flag: -        h = "" -        for index in range(len(s_)): -            if i <= index <= i + len(t) - 1: -                h += t[index - i] -            else: -                h += s_[index] -        exit_flag = False -if exit_flag: +tcnt = len(t) +point = 0 +unrestorable = True +while point <= scnt - tcnt: +    oneroopcorres = True +    for i in range(tcnt): +        anyone = sd[point + i] == "?" +        correspond = sd[point + i] == t[i] +        if not (anyone or correspond): +            oneroopcorres = False +    if oneroopcorres: +        unrestorable = False +        good_point = point +    point += 1 +if unrestorable: -h = h.replace("?", "a") -print(h) +else: +    sd = list(sd) +    for i in range(tcnt): +        sd[good_point + i] = t[i] +    sd = "".join(sd) +sd = sd.replace("?", "a") +print(sd)