import re

s,t=input().replace(*"?."),eval(input())

l,m,*c=len(s),len(t)

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

 if re.match(s[i:i+m],t):c+=(s[:i]+t+s[i+m:]).replace(*".a"),

print((c and min(c)or"UNRESTORABLE"))
s,t=input(),input();l,m=len(s),len(t)

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

 if all(c in"?"+d for c,d in zip(s[-i-m:],t)):s=s.replace(*"?a");exit(print(s[:-i-m]+t+s[l-i:]))

print("UNRESTORABLE")

import re

s, t = input().replace(*"?."), eval(input())
l, m, *c = len(s), len(t)
for i in range(l - m + 1):
    if re.match(s[i : i + m], t):
        c += ((s[:i] + t + s[i + m :]).replace(*".a"),)
print((c and min(c) or "UNRESTORABLE"))

s, t = input(), input()
l, m = len(s), len(t)
for i in range(l - m + 1):
    if all(c in "?" + d for c, d in zip(s[-i - m :], t)):
        s = s.replace(*"?a")
        exit(print(s[: -i - m] + t + s[l - i :]))
print("UNRESTORABLE")

-import re - -s, t = input().replace(*"?."), eval(input()) -l, m, *c = len(s), len(t) +s, t = input(), input() +l, m = len(s), len(t) -    if re.match(s[i : i + m], t): -        c += ((s[:i] + t + s[i + m :]).replace(*".a"),) -print((c and min(c) or "UNRESTORABLE")) +    if all(c in "?" + d for c, d in zip(s[-i - m :], t)): +        s = s.replace(*"?a") +        exit(print(s[: -i - m] + t + s[l - i :])) +print("UNRESTORABLE")