E869120 found a chest which is likely to contain treasure.

However, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.

He also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.  
One more thing he found is a sheet of paper with the following facts written on it:  
 - Condition 1: The string S contains a string T as a contiguous substring.
 - Condition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.
Print the string S.

If such a string does not exist, print UNRESTORABLE.  

-----Constraints-----
 - 1 \leq |S'|, |T| \leq 50
 - S' consists of lowercase English letters and ?.
 - T consists of lowercase English letters.

-----Input-----
Input is given from Standard Input in the following format:
S
T'

-----Output-----
Print the string S.

If such a string does not exist, print UNRESTORABLE instead.  

-----Sample Input-----
?tc????
coder

-----Sample Output-----
atcoder

There are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.
Among them, the lexicographically smallest is atcoder, so we can say S = atcoder.

Difficulty: introductory

Starter code:

Solutions:
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 28 02:20:36 2020

@author: liang
"""
S = input()
T = input()

S = S[::-1]
T = T[::-1]

res = list()

for i in range(len(S)-len(T)+1):
    flag = True
    for j in range(len(T)):
        if S[i+j] == "?" or S[i+j] == T[j]:
            continue
        else:
            flag = False
    if flag == True:
        ans = ""
        for k in range(len(S)):
            if i <= k <= i + len(T)-1:
                #print(T[k-i])
                ans += T[k-i]
            elif S[k] != "?":
                #print("B")
                ans += S[k]
            else:
                #print("C")
                ans += "a"
        ans = ans[::-1]
        res.append(ans)

if res:
    res.sort()
    print((res[0]))
else:
    print("UNRESTORABLE")
#print(S)
#print(T)


s = input()
t = input()

ls = len(s)
lt = len(t)
check = False
ans = 'z'*60
for i in range(ls-lt+1):
    u = list(s)
    flag = True
    for j in range(lt):
        if u[i+j] == '?':
            u[i+j] = t[j]
        elif u[i+j] != t[j]:
            flag = False
            break
    if flag:
        check = True
        u = ''.join(u).replace('?', 'a')
        ans = sorted([ans, u])[0]
print(ans if check else 'UNRESTORABLE')

S_ = list(input())
T = input()
#後ろから探索する

n = len(S_)
m = len(T)
nonexist = 1
for i in range(n-1, m-2, -1):
    flg = True
    for j in range(m):
        if (S_[i-j] != T[-j-1]) and (S_[i-j] != "?"):
            flg = False
            break
    if flg:
        nonexist = 0
        index = i
        break

if nonexist:
    print("UNRESTORABLE")
    return

index -= m-1
for i in range(m):
    S_[index+i] = T[i]

for i in range(n):
    if S_[i] == "?":
        S_[i] = "a"
print(("".join(S_)))


s = input()
t = input()

for i in range(len(s) - len(t) + 1)[::-1]:
    cnt = 0
    q = 0
    for j in range(len(t))[::-1]:
        if s[i + j] == '?':
            q += 1
        elif s[i + j] == t[j]:
            cnt += 1
    
    if cnt == len(t) - q:
        idx = i
        s = s[:idx] + t + s[idx + len(t):]
        for k in range(len(s)):
            if s[k] == '?':
                s = s[:k] + 'a' + s[k + 1:]
        print(s)
        break
else:
    print('UNRESTORABLE')

s = input()[::-1]
t = input()[::-1]

def match(string,substring):
    for a,b in zip(string, substring):
        if a == '?':
            continue
        if a != b:
            return False
    return True

# なるべく後方で一致させる
LEN_S = len(s)
LEN_T = len(t)
ans = ''
for i in range(LEN_S - LEN_T + 1):
    sub = s[i:i+LEN_S]
    if match(sub, t):
        ans = s[:i] + t + s[i+LEN_T:]
        ans = ans[::-1].replace('?', 'a')
        break
else:
    print('UNRESTORABLE')
    return

print(ans)

s = list(input())
t = list(input())
num = len(t)

fail = 'UNRESTORABLE'
flag = False
ans = []
count_out = 0

for i in range(len(s)):
    start = i
    end = i + len(t)
    if (end > len(s)):
        break
    tar = s[start:end]
    # print(tar)
    index = 0
    name_flag = True

    for a, b in zip(tar, t):
        # print(tar[index])
        if (a == b):
            pass
        elif (a == '?'):
            tar[index] = str(b)
        else:
            name_flag = False
            break

        index += 1

    if (name_flag is False):
        ans.append(['z'] * len(s))
        count_out += 1
    else:
        pre_org = s[:start]
        # pre = pre_org.replace('?', 'a')
        post_org = s[end:]
        # post = post_org.replace('?', 'a')

        # tar_mod = pre + tar + post
        tar_mod = pre_org + tar + post_org
        ans.append(tar_mod)

# print(ans)
if (count_out == (len(s) - len(t) + 1)):
    print(fail)
else:
    ans_s = sorted(ans)
    aa = ans_s[0]
    a2 = ''.join(aa)
    a3 = a2.replace('?', 'a')
    print(a3)


s = input()
t = input()

s_streak = 0
s_streak_ind = -1


for j in range(len(s)-1, -1, -1):
	for i in range(j, -1, -1):
		if s_streak_ind == -1:
			if s[i] == "?" or s[i] == t[len(t)-1-s_streak]:
				if s_streak == len(t) - 1:
					s_streak_ind = i
					s_streak = 0
				else:
					s_streak += 1
			else:
				s_streak = 0
	s_streak = 0

#print(s_streak_ind)

if s_streak_ind == -1:
	print("UNRESTORABLE")
else:
	ansl = []
	for i in range(len(s)):
		if s[i] == "?":
			if s_streak_ind <= i < s_streak_ind+len(t):
				ansl.append(t[i-s_streak_ind])
			else:
				ansl.append("a")
		else:
			ansl.append(s[i])
	print("".join(ansl))

S = list(input())
T = list(input())
s = len(S)
t = len(T)
for i in range(s-t,-1,-1):
    ss = S[i:i+t]
    for j in range(t):
        if ss[j] != "?" and ss[j] != T[j]:
            break
    else:
        for j in range(t):
            if ss[j] == "?":
                S[i+j] = T[j]
        break
else:
    print("UNRESTORABLE")
    return
for i in range(s):
    if S[i] == "?":
        S[i] = "a"
print("".join(S))

import copy
S = list(input())
T = input()
lS = len(S)
lT = len(T)
ans = []
for s in range(lS-lT+1):
    temp = copy.copy(S)
    for t in range(lT):
        if temp[s+t] != T[t] and temp[s+t] != '?':
            break
        else:
            temp[s+t] = T[t]
    else:
        temp = [temp[i] if temp[i] != '?' else 'a' for i in range(lS)]
        ans.append(''.join(temp))
ans = sorted(ans)
if len(ans) == 0:
    print('UNRESTORABLE')
else:
    print(ans[0])

S_ = input()
T = input()
len_T = len(T)
len_S = len(S_)

A = []
for i in range(len_S - len_T + 1):
    flg = True
    for t, s in zip(T, S_[i:i + len_T]):
        if s != '?' and s != t:
            flg = False
    if flg == True:
        S = ''
        for j in range(len_S):
            if i <= j < i + len_T:
                S += T[j - i]
            elif S_[j] == '?':
                S += 'a'
            else:
                S += S_[j]
        A.append(S)

ans = 'z' * (len_S + 1)
for S in A:
    if S < ans:
        ans = S
if ans == 'z' * (len_S + 1):
    print('UNRESTORABLE')
else:
    print(ans)

S=input()
T=input()
L,M=len(S),len(T)
a=-1
for i in range(L-M,-1,-1):
    if sum([1 for j in range(M) if S[i+j]=='?' or S[i+j]==T[j]])==M:
        a=i
        break
print('UNRESTORABLE' if a<0 else ''.join([T[i-a] if a<=i<a+M else 'a' if S[i]=='?' else S[i] for i in range(L)]))

import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return list(map(int, stdin.readline().split()))
def nl(): return list(map(int, stdin.readline().split()))


def can_replace(S, T):
    cnt = 0
    for s, t in zip(S, T):
        if s == t or s == '?':
            cnt += 1
    if cnt == len(S):
        return True
    else:
        return False


def main():
    S = list(ns()[::-1])
    T = list(ns()[::-1])
    for i in range(len(S) - len(T) + 1):
        if can_replace(S[i:i + len(T)], T):
            S[i:i + len(T)] = T
            S = ''.join(S)
            print((S.replace('?', 'a')[::-1]))
            return
    print('UNRESTORABLE')


def __starting_point():
    main()

__starting_point()

s = input()
t = input()
n, m = len(s), len(t)

for i in range(n - m, -1, -1):
    match = True
    for j in range(m):
        if s[i + j] != '?' and s[i + j] != t[j]:
            match = False
            break
    if match:
        print((s[:i].replace('?', 'a') + t + s[i + m:].replace('?', 'a')))
        return
print("UNRESTORABLE")


s = input()
t = input()

s_length = len(s)
t_length = len(t)

ans = ''
keep = ''
remind = 0
checker = False
for i in range(s_length):
    if (i + t_length) <= s_length:
        check = True
        for j in range(t_length):
            if (s[i + j] != t[j]) & (s[i + j] != '?'):
                check = False
        if check:
            checker = True
            ans = keep + t
            remind = i + t_length
    if s[i] == '?':
        keep += 'a'
    else:
        keep += s[i]
ans = ans + keep[remind:]

if checker:
    print(ans)
else:
    print('UNRESTORABLE')


Sp = str(input())
T = list(input())
ans = []
ANS = []
for i in range(len(Sp)-len(T)+1):
  S = list(Sp)
  for j in range(len(T)):
    if S[i+j] == T[j] or S[i+j] == "?":
      S[i+j] = T[j]
      if j == len(T)-1:
        ans.append(S)
    else:
      break
if len(ans) == 0:
  print('UNRESTORABLE')
else:
  for i in range(len(ans)):
    for j in range(len(Sp)):
      if ans[i][j] == "?":
        ans[i][j] = "a"
    ANS.append("".join(ans[i]))
  ANS.sort()
  print(ANS[0])

import re

s = input().replace('?', '.')
t = input()

for i in range(len(s)-len(t), -1, -1):
    if re.match(s[i:i+len(t):], t):
        s = s.replace('.', 'a')
        print(s[:i:]+t+s[i+len(t)::])
        return
print('UNRESTORABLE')

s=list(input())
ls=len(s)
t=list(input())
lt=len(t)
can=[]
for i in range(ls-lt,-1,-1):
    ok=0
    for j in range(lt):
        if s[i+j]==t[j] or s[i+j]=='?':
            ok+=1
    if ok==lt:
        c=[0]*ls
        for k in range(ls):
            if s[k]=='?':
                if k<i or k>=i+lt:
                    c[k]='a'
                else:
                    c[k]=t[k-i]
            else:
                c[k]=s[k]
        can.append(''.join(c))
if len(can)==0:
    print('UNRESTORABLE')
else:
    print(sorted(list(can))[0])

s,t=input(),input()
ans='z'*len(s)
for i in range(len(s)-len(t)+1):
    pre=s[:i].replace("?",'a')
    
    for x,y in zip(list(s[i:]),list(t)):
        if x!="?"and x!=y:break
        pre+=y
    else:
        pre+=s[i+len(t):].replace("?",'a')
        ans=min(ans,pre)
print(ans if ans!='z'*len(s) else 'UNRESTORABLE')

s=input()
T=input()

s=''.join([x if x!='?' else '1' for x in list(s)])

start=[]
for i in range(len(s)-len(T)+1):
    tmp=0
    for j in range(len(T)):
        if s[i+j]==T[j] or s[i+j]=='1': tmp+=1
    if tmp==len(T): start.append(i)

candidates=[]
t=len(T)
ans=''
if len(start):
    for st in start:
        tmp=s[:st]+T+s[st+t:]
        candidates.append(tmp)
    candidates.sort()
    ans=candidates[0].replace('1','a')
else:
    ans='UNRESTORABLE'

print(ans)


S = input()[::-1]
T = input()[::-1]

flag = False
for i in range(len(S) - len(T) + 1):
    matched = True

    for j in range(len(T)):

        if S[i + j] != "?" and S[i + j] != T[j]:
            matched = False
    
    if matched:
        S = S[:i] + T + S[i + len(T):]
        flag = True
        break

if flag:
    print(S.replace("?", "a")[::-1])
else:
    print("UNRESTORABLE")

s = input()
n = len(s)
t = input()
m = len(t)
ans = []

for i in range(n-m+1):
    for j in range(m):
        if s[i+j] not in [t[j] , "?"]:
            break
        elif j == m-1:
            res = s[:i]+t+s[i+m:]
            ans.append(res.replace("?","a"))

if not ans:
    ans.append("UNRESTORABLE")

print(min(ans))

S = input()[::-1]
T = input()[::-1]

flag = False
for i in range(len(S) - len(T) + 1):
    matched = True

    for j in range(len(T)):
        # うーん...
        if i == len(S) - len(T) + 1:
            break

        if S[i + j] != "?" and S[i + j] != T[j]:
            matched = False
    
    if matched:
        S = S[:i] + T + S[i + len(T):]
        flag = True
        break

if flag:
    print(S.replace("?", "a")[::-1])
else:
    print("UNRESTORABLE")

s = input()
t = input()
ans = list(s)

if len(s)>=len(t):
    for i in reversed(list(range(len(s)-len(t)+1))):
        flg=True
        for j in range(len(t)):
            if s[i+j]=="?":
                continue
            if s[i+j]!=t[j]:
                flg=False
                break
        if flg:
            for j in range(len(t)):
                ans[i+j]=t[j]

            break
else:
    flg=False

ans = "".join(ans)
ans = ans.replace("?","a")

print((ans if flg else "UNRESTORABLE"))



s = input()
t = input()
match_index = 51
for i in range(len(s) - len(t) + 1):
    s_tmp = s[i:i + len(t)]
    for j in range(len(t)):
        if s_tmp[j] == t[j] or s_tmp[j] == "?":
            pass
        else:
            break
    else:
        match_index = i

if match_index == 51:
    print("UNRESTORABLE")
else:
    s_replace = ""
    for i in range(match_index):
        s_replace += s[i]
    s_replace += t
    for i in range(match_index + len(t), len(s)):
        s_replace += s[i]

    # s[match_index:match_index + len(t)] = t
    res = ""
    for i in s_replace:
        if i == "?":
            res += "a"
        else:
            res += i
    print(res)



s_o = str(input().strip())
t_o = str(input().strip())
dic = []

for i in range(len(s_o)-len(t_o)+1):
    s = s_o
    t = t_o
    flg = 0
    for j in range(len(t_o)):
        if s[i+j] == t[j] or s[i+j] == "?":
            s = s[:i+j] + t[j] + s[i+j+1:]
        else:
            flg = 1
            break
    if flg:
        continue
    s = s.replace("?", "a")
    dic.append(s)

if len(dic) == 0:
    print("UNRESTORABLE")
else:
    dic.sort()
    print(dic[0])

import sys
import re
import queue
import collections
import math
from decimal import *
from copy import deepcopy
from collections import Counter, deque
import heapq
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from typing import Callable
from decimal import Decimal, getcontext
# input = sys.stdin.readline
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
	S_dush = s_input()
	T = s_input()

	answer_list = []

	for i in range(0,len(S_dush)-len(T)+1):
		flag = True
		count = 0
		for j in range(0,len(T)):
			if(S_dush[i+j]!="?" and S_dush[i+j] != T[j]):
				count = j
				flag = False
		if(flag):
			tmp = ""
			for j in range(0,len(S_dush)):
				if(S_dush[j]=="?"):
					tmp = tmp + "a"
				else:
					tmp = tmp + S_dush[j]
			tmp = tmp[0:i] + T + tmp[i+len(T):len(S_dush)]
			answer_list.append(tmp)
	
	if(len(answer_list) ==0):
		print("UNRESTORABLE")
	else:
		answer_list.sort()
		print(answer_list[0])



def __starting_point():
	main()
__starting_point()

#abc076 C
from copy import deepcopy
s = list(input())
t = list(input())
ls = len(s)
lt = len(t)

rev_s = s[::-1]
rev_t = t[::-1]

for x in range(ls-lt+1):
    if rev_s[x:x+lt] == ["?"] * lt:
        for y in range(lt):
            rev_s[x+y] = rev_t[y]
        ns = rev_s[::-1]
        S = "".join(ns)
        ans = S.replace("?", "a")
        print(ans)
        return


for i in range(lt):
    for j in range(i, ls):
        if rev_t[i] == rev_s[j]:
            flag = True
            t_temp = deepcopy(rev_t)
            s_temp = deepcopy(rev_s)
            for k in range(-i, lt-i):
                if j+k >= ls or j+k < 0:
                    flag = False
                    break
                elif t_temp[i+k] == s_temp[j+k]:
                    pass
                elif s_temp[j+k] == "?":
                    s_temp[j+k] = t_temp[i+k]
                elif t_temp[i+k] != s_temp[j+k]:
                    flag = False
                    break
            if flag:
                ns = s_temp[::-1]
                S = "".join(ns)
                ans = S.replace("?", "a")
                print(ans)
                return

print("UNRESTORABLE")

sd = input()
t = input()

n = len(sd)
m = len(t)
s = []

# sd を後ろから見ていき、 t の入りそうな場所を探す
for i in range(n - m, -1, -1):
    t_kamo = sd[i:i + m]
    for j in range(m + 1):
        # 1文字ずつ順に入りうるか調べ、最後まで入るなら "?" を "a" に置き換えて出力
        if j == m:
            print((sd[:i] + t + sd[i + len(t):]).replace("?", "a"))
            return
        if t_kamo[j] == "?":
            continue
        elif t_kamo[j] != t[j]:
            break

print("UNRESTORABLE")

s = input()
t = input()
l = []
for i in range(len(s)-len(t)+1):
    for j in range(i, i+len(t)):
        if s[j] != "?" and s[j] != t[j-i]:
            break
    else:
        l.append(s[:i]+t+s[i+len(t):])
if len(l) == 0:
    print("UNRESTORABLE")
    return
l.sort()
print(l[0].replace("?", "a"))

s = input()
t = input()
n = len(s)
m = len(t)
ans = []
for i in range(n-m+1):
    c = 0
    for j in range(m):
        if s[i+j] == '?' or s[i+j] == t[j]:
            c += 1
    if c == m:
        s_ = s[0:i] + t + s[i+m:]
        s_ = s_.replace('?', 'a')
        ans.append(s_)
if len(ans)>0:
    print((sorted(ans)[0]))
else:
    print('UNRESTORABLE')


s=input()
t=input()
ls=len(s)
lt=len(t)

ans=0
for i in range(ls-lt+1):
  x=s[:i]+t+s[i+lt:ls]
  f=1
  for j in range(ls):
    if s[j]=='?':
      continue
    if s[j]!=x[j]:
      f=0
      break
  if f:
    p=''
    for k in range(ls):
      if x[k]=='?':
        p+='a'
      else:
        p+=x[k]
    ans=p
    
if ans:
  print(p)
else:
  print('UNRESTORABLE')


S0 = input()
T = input()

n, m = len(S0), len(T)
if n < m:
    print("UNRESTORABLE")
    return

start, end = -1, -1
for i in reversed(range(n - m + 1)):
    ok = True
    for j in range(m):
        ok = ok and (S0[i + j] == T[j] or S0[i + j] == '?')
    if ok:
        start = i
        end = i + m - 1
        break

if start >= 0:
    S = ''
    for i in range(n):
        if start <= i <= end:
            S += T[i - start]
        else:
            if S0[i] == '?':
                S += 'a'
            else:
                S += S0[i]
    print(S)
else:
    print("UNRESTORABLE")

a = input()
b = input()

length = len(a) - len(b) + 1

ans = []
for i in range(length):
    A = list('?'*i+b+'?'*(length-i-1))
    flag = True
    for j in range(len(a)):
        if a[j] == '?' or a[j] == A[j]:
            pass
        elif a[j] != '?' and A[j] == '?':
            A[j] = a[j]
        else:
            flag = False
    if flag:
        ans.append(''.join(A).replace('?','a'))

if ans:
    ans.sort()
    print(ans[0])
else:
    print('UNRESTORABLE')

Sd = input()
T = input()
#Sdの?以外の文字のインデックスを取得
indexes = []
for i in range(len(Sd)):
    if Sd[i] != "?":
        indexes.append(i)

t0 = 0#tの先頭位置
S_list = []
while t0 <= (len(Sd)-len(T)):
    flg = 0
    tmp_S = Sd[:t0] + T + Sd[t0+len(T):]

    #条件1を満たすかどうかのチェック
    for index in indexes:
        if Sd[index] != tmp_S[index]:#Sdと一致していなかったら
            flg = 1
    if flg:#flgが立った文字列は条件を満たさないためスキップ
        t0 += 1
        continue

    #?にaを積めてリストに格納
    tmp_S = tmp_S.replace('?', 'a')
    S_list.append(tmp_S)
    t0 += 1

if not S_list:
    print("UNRESTORABLE")
    return

S_list.sort()#辞書式にソート
print(S_list[0])

def main():
    s = input()
    t = input()
    n = len(s)
    m = len(t)
    ans = []
    for i in range(n-m+1):
        c = 0
        for j in range(m):
            if s[i+j] == '?' or s[i+j] == t[j]:
                c += 1
        if c == m:
            s_ = s[0:i] + t + s[i+m:]
            s_ = s_.replace('?', 'a')
            ans.append(s_)
    if len(ans)>0:
        print((sorted(ans)[0]))
    else:
        print('UNRESTORABLE')

def __starting_point():
    main()

__starting_point()

S = input()
Sa = S.replace("?", "a")
T = input()
nt = len(T)
ans = list()
for i in range(len(S) - nt + 1):
    X = S[i: i + nt]
    for x, t in zip(X, T):
        if x == "?":
            continue
        if x != t:
            break
    else:
        ans.append(Sa[:i] + T + Sa[i + nt:])
ans.sort()
print((ans[0] if ans else "UNRESTORABLE"))



# import itertools
# import math
# from functools import reduce
# import sys
# sys.setrecursionlimit(500*500)
# import numpy as np
# import heapq
# from collections import deque

# N = int(input())
S_prime = input()
# n, *a = map(int, open(0))
# N, M = map(int, input().split())
# A = list(map(int, input().split()))
# B = list(map(int, input().split()))
# tree = [[] for _ in range(N + 1)]
# B_C = [list(map(int,input().split())) for _ in range(M)]
T = input()

# B_C = sorted(B_C, reverse=True, key=lambda x:x[1])
# all_cases = list(itertools.permutations(P))
# a = list(itertools.combinations_with_replacement(range(1, M + 1), N))
# itertools.product((0,1), repeat=n)

# A = np.array(A)
# cum_A = np.cumsum(A)
# cum_A = np.insert(cum_A, 0, 0)

# def dfs(tree, s):
#     for l in tree[s]:
#         if depth[l[0]] == -1:
#             depth[l[0]] = depth[s] + l[1]
#             dfs(tree, l[0])
# dfs(tree, 1)

# def factorization(n):
#     arr = []
#     temp = n
#     for i in range(2, int(-(-n**0.5//1))+1):
#         if temp%i==0:
#             cnt=0
#             while temp%i==0:
#                 cnt+=1
#                 temp //= i
#             arr.append([i, cnt])
#     if temp!=1:
#         arr.append([temp, 1])
#     if arr==[]:
#         arr.append([n, 1])
#     return arr

#def make_divisors(n):
#    lower_divisors , upper_divisors = [], []
#    i = 1
#    while i*i <= n:
#        if n % i == 0:
#            lower_divisors.append(i)
#            if i != n // i:
#                upper_divisors.append(n//i)
#        i += 1
#    return lower_divisors + upper_divisors[::-1]

# def gcd_list(numbers):
#     return reduce(math.gcd, numbers)

# if gcd_list(A) > 1:
#     print("not coprime")
#     return

# 高速素因数分解準備
#MAXN = 10**6+10
#sieve = [i for i in range(MAXN+1)]
#p = 2
#while p*p <= MAXN:
#    if sieve[p] == p:
#        for q in range(2*p, MAXN+1, p):
#            if sieve[q] == q:
#                sieve[q] = p
#    p += 1

start_ind = -1
for i in range(len(S_prime) - len(T) + 1):
    for j, c in enumerate(T):
        if S_prime[i + j] == c or S_prime[i + j] == "?":
            pass
        else:
            break
    else:
        start_ind = i
    
if start_ind == -1:
    print("UNRESTORABLE")
    return

S = S_prime[:start_ind] + T + S_prime[start_ind + len(T):]
print(S.replace("?", "a"))

_S = list(input())
T = list(input())

N = len(_S)
M = len(T)

candidates = []

for i in range(N - M + 1):
    if _S[i] == '?' or _S[i] == T[0]:
        S = _S.copy()
        flg = True
        for j in range(M):
            if S[i + j] == '?':
                S[i + j] = T[j]
            elif S[i + j] != T[j]:
                flg = False
                break
        if flg:
            for k in range(N):
                if S[k] == '?':
                    S[k] = 'a'
            candidates.append(''.join(S))

if len(candidates) == 0:
    print('UNRESTORABLE')
else:
    print((min(candidates)))


s = list(input())
t = list(input())
ls, lt = len(s), len(t)
#リストを反転させてケツから調べる事で辞書順最小を求める
s.reverse()
t.reverse()
for i in range(ls):
    for j in range(lt): #このfor文が全部回ればt in sである
        if i + j >= ls:
            break
        if s[i+j] != '?' and s[i+j] != t[j]:
            break
    else: 
        for j in range(lt):
            s[i+j] = t[j]
        s = [x if x != '?' else 'a' for x in s]
        s.reverse()
        ans = ''.join(s)
        break
else:
    ans = 'UNRESTORABLE'
print(ans)

import re
s = input().replace("?",".")
t = input()
for i in range(len(s)-len(t),-1,-1):
  if re.match(s[i:i+len(t)],t):
    s = s.replace(".","a")
    print(s[:i]+t+s[i+len(t):])
    return
print("UNRESTORABLE")

ss = input()
t = input()

ls = len(ss)
lt = len(t)

before = []
after = []

for i in range(ls-lt+1):
    for j in range(lt):
        if ss[i+j]!="?":
            if ss[i+j]!=t[j]:
                break
    else:
        before += [ss[:i]+t+ss[i+lt:]]
  
for k in before:
    after += [k.replace("?","a")]

if after:
    after = sorted(after)
    print(after[0])
else:
    print("UNRESTORABLE")


def main():
    with open(0) as f:
        S, T = f.read().split()
    for i in reversed(range(len(S)-len(T)+1)):
        for j in reversed(range(len(T))):
            if S[i+j] == T[j] or S[i+j] == '?':
                continue
            else:
                break
        else:
            S = S[:i] + T + S[i+len(T):]
            S = S.replace('?', 'a')
            print(S)
            break
    else:
        print('UNRESTORABLE')

main()

S = list(input())
T = list(input())
S.reverse()
T.reverse()
flag = False
for i in range(len(S)-len(T)+1):
    k = 0
    for t in range(i,i+len(T)):
        if S[t] != '?' and S[t] != T[k]:
            break
        k += 1
        if k == len(T):
            flag = True
            w = i
    if flag:
        break
t = 0
if flag:
 for i in range(w,w+len(T)):
    S[i] = T[t]
    t += 1
 S.reverse()
 an = ''
 for i in range(len(S)):
    if S[i] == '?':
        an += 'a'
    else:
        an += S[i]
 print(an)
else:
    print('UNRESTORABLE')

s = input()
t = input()

ans = 'z' * len(s)
tmp = 'z' * len(s)

x = False
for i in range(len(s)-len(t)+1):
    ok = True
    for j in range(len(t)):
        if not (s[i+j] == '?' or s[i+j] == t[j]):
            ok = False
    
    if ok:
        x = True
        tmp = s[:i] + t + s[i+len(t):]
        if ans > tmp:
            ans = tmp

if x:
    ans = ans.replace("?", "a")
    print(ans)
else:
    print('UNRESTORABLE')


S=input()
T=input()

lt=len(T)
ls=len(S)
S+='%'*lt

if ls<lt:
    flg=0
else:
    for i in range(ls-lt+1,-1,-1):
        # print('***',S[i:i+lt])
        flg=1
        for j in range(i,i+lt):
            s=S[j]
            # print(s,T[j-i])
            if s=='?': continue
            if s=='%' or s!=T[j-i]:
                flg=0
                break
        if flg==1:
            break
if flg:
    print((S[0:i]+T+S[i+lt:ls]).replace('?','a'))
else:
    print('UNRESTORABLE')

s = input()
t = input()
ans = ''

# for i in range(len(s)-len(t)+1):
for i in range(len(s)-len(t), -1, -1):
    st = s[i:i+len(t)]
    cnt = 0
    for si, ti in zip(st, t):
        if si == '?' or si == ti:
            cnt += 1
        # print(si, ti, cnt)
    if cnt == len(t):
        ans = s[:i] + t + s[i+len(t):]
        ans = ans.replace('?', 'a')
        print(ans)
        return
else:
    print('UNRESTORABLE')




import math
from math import gcd,pi,sqrt
INF = float("inf")

import sys
sys.setrecursionlimit(10**6)
import itertools
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return list(map(int, input().split()))
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]


def main():
    s = input() # 暗号
    t = input() # 含まれる文字

    s_len = len(s)
    t_len = len(t)
    flg = False

    for i in range(s_len - t_len,-1,-1):
        flg = True
        for j in range(t_len):
            if s[i+j] != t[j] and s[i+j] != "?":
                flg = False
                break
        if flg == True:
            trial = i
            break

    if flg == False:
        print("UNRESTORABLE")
        return

    ans = ""
    for i in s[:trial]:
        if i == "?":
            ans = ans + "a"
        else:
            ans = ans + i
    ans = ans + t

    for i in s[(trial+t_len):]:
        if i == "?":
            ans = ans + "a"
        else:
            ans = ans + i

    print(ans)














def __starting_point():
    main()

__starting_point()

s = input()[::-1]
t = input()[::-1]
x = ""
for i in range(0,len(s)-len(t)+1):
    if x == "": x = s[i:i+len(t)]
    else:x = x[1:] + s[i+len(t)-1]
    flag = True
    for j in range(len(t)):
        if x[j] == "?" or x[j] == t[j]: continue
        else: flag = False
    if flag:
        s = (s[:i] + t + s[i+len(t):])[::-1]
        print(s.replace("?", "a"))
        return
print("UNRESTORABLE")

S=input()
T=input()

lt=len(T)
ls=len(S)
if ls<lt:flg=0
else:
 for i in range(ls-lt,-1,-1):
  flg=1
  for s,t in zip(S[i:i+lt],T):
    if s=='?' or s==t: continue
    flg=0
  if flg:break
print((S[0:i]+T+S[i+lt:ls]).replace('?','a') if flg else 'UNRESTORABLE')

#!/bin/python3
s=list(input())
t=list(input())

lens=len(s)
lent=len(t)

for i in reversed(list(range(lens-lent+1))):
  x=s[i:i+lent]
  ans=s
  flag=True
  #print("x",x,len(x))
  for j in range(lent):
    if x[j]!=t[j] and x[j]!="?":
      flag=False
      break
    #if x[j]=="?":
    #  #tと同じ部分
    #  #print("i",i,"j",j)
    #  ans[i+j]=t[j]
  if flag:
    #tより前の部分
    #ans[:i]=["a" if a=="?" else a for a in ans[:i]]
    #tより後ろの部分
    #if i+lent<=lens:
    #  ans[i+lent:lens]=["a" if a=="?" else a for a in ans[i+lent:lens]]
    ans=["a" if a=="?" else a for a in ans[:i]]+\
    	t+["a" if a=="?" else a for a in ans[i+lent:]]
    print(("".join(ans)))
    return
print("UNRESTORABLE")
#print("ans",ans)



import sys
import math
import re

#https://atcoder.jp/contests/agc008/submissions/15248942
sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

s2 = input()
t = input()

#辞書順の小さいものを作るためにパターンマッチは後ろから実施したい
#ので入力を反転させる
s2_r = s2[::-1]
t_r = t[::-1]

ans_flag = False
#全文字の組み合わせを試す
for i in range(len(s2)):
    for j in range(i+1,len(s2)+1):
        #tと同じ文字数の時だけ部分一致するか判定する
        if (j-i) == len(t_r):
            flag = True
            #一文字ごとに判定する
            for k,l in enumerate(range(i,j)):
                if s2_r[l] != t_r[k] and s2_r[l] != '?':
                    flag = False
            if flag == True:
                #一致した位置を置換
                ans = s2_r[:i] + t_r + s2_r[j:]
                #残りの?を辞書順最小のaに置換
                ans = ans.replace('?','a')
                #元の順番に反転
                ans = ans[::-1]
                print(ans)                
                ans_flag = True
                break

    #forをbreakしないとcontinueする
    else:
        continue
    break
            
if ans_flag == False:
    print('UNRESTORABLE')

S = input()[::-1]
T = input()[::-1]

flag = False
for i in range(len(S) - len(T) + 1):
    matched = True

    for j in range(len(T)):

        if S[i + j] != "?" and S[i + j] != T[j]:
            matched = False
            break
    
    if matched:
        S = S[:i] + T + S[i + len(T):]
        flag = True
        break

if flag:
    print(S.replace("?", "a")[::-1])
else:
    print("UNRESTORABLE")

S=input()
T=input()

lt=len(T)
ls=len(S)
if ls<lt:f=0
else:
 for i in range(ls-lt,-1,-1):
  f=1
  for s,t in zip(S[i:i+lt],T):
    if s=='?' or s==t: continue
    f=0
  if f:break
print((S[0:i]+T+S[i+lt:ls]).replace('?','a') if f else 'UNRESTORABLE')

#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**6)

s = list(str(input()))
t = list(str(input()))

ans = []
for i in range(len(s)-len(t)+1):
    # print(i)
    ans_tmp = ""
    for j in range(len(s)):
        if j >= i and i+len(t) > j:
            if s[j] == "?" or s[j] == t[j-i]:
                ans_tmp += t[j-i]
            else:
                break
        else:
            if s[j] == "?":
                ans_tmp += "a"
            else:
                ans_tmp += s[j]

    if len(ans_tmp) != len(s):
        continue
    else:
        ans.append(ans_tmp)
ans.sort()

if len(ans) == 0:
    print("UNRESTORABLE")
else:
    print((ans[0]))


#!/usr/bin/env python3

#import
#import math
#import numpy as np
#= int(input())
S = list(input())
T = list(input())

ls = len(S); lt = len(T)

for i in range(ls - lt, -1, -1):
    isok = True
    for j in range(lt):
        if S[i + j] == "?":
            continue
        if S[i + j] != T[j]:
            isok = False
            break
    if isok:
        S[i:i+lt] = T
        ans = ""
        for s in S:
            if s == "?":
                ans += "a"
            else:
                ans += s
        print(ans)
        return

print("UNRESTORABLE")


S = input()
T = input()

n = len(S)
l = len(T)

for i in range(n-l+1)[::-1]:
  cnt = 0
  for j in range(l):
    if S[i+j] == "?" or S[i+j] == T[j]:
      cnt += 1
  
  if cnt == l:
    S = list(S[:i] + T + S[i+l:])
    for k in range(n):
      if S[k] == "?":
        S[k] = "a"
    print("".join(S))
    break
    
else:
  print("UNRESTORABLE")

def main():
    s=input()
    t=input()
    ans=[]
    for i in range(len(s)-len(t)+1):
        for j in range(len(t)):
            if len(s) <= i+j or (s[i+j] != t[j] and s[i+j] != "?"):
                break
        else:
            ans.append((s[:i]+t+s[i+j+1:]).replace("?", "a"))
    ans.sort()
    print(ans[0] if len(ans) > 0 else "UNRESTORABLE")
    
def __starting_point():
    main()
__starting_point()

S=list(input())[::-1]
T=list(input())[::-1]
for i in range(len(S)-len(T)+1):
  ans = S[:i]
  for j in range(len(T)):
    if S[i+j] != "?" and S[i+j] != T[j]:
      break
    else:
      ans.append(T[j])
  else:
    for j in range(i+len(T),len(S)):
      ans.append(S[j])
    print("".join(map(str,ans[::-1])).replace("?","a"))
    break
else:
  print("UNRESTORABLE")

S = input()
T = input()
 
ls = len(S)
lt = len(T)
left = -1
 
for i in range(ls-lt+1):
    for j in range(lt):
        if S[i+j] != "?" and S[i+j] != T[j]:
            break
    else:
       left = i
if left == -1:
    ans = "UNRESTORABLE"
else:
    ans = S[:left]+T+S[left+lt:]
    ans = ans.replace("?", "a")
print(ans)

s = input()
t = input()

soln = ""

for i in range(len(s)-len(t)+1):
    sol = True
    for j in range(len(t)):
        if not (s[i+j] == t[j] or s[i+j] == "?"):
            sol = False
            break

    if sol:
        soln = s[:i] + t + s[i+len(t):]

print(soln.replace("?", "a") if soln != "" else "UNRESTORABLE")

import copy
s = list(input())
t = list(input())

t1, t2 = copy.deepcopy(s), copy.deepcopy(s)
ok = []
ch = True
if ch:
  for i in range(len(s)-len(t)+1):
    count = 0
    for j in range(len(t)):
      if s[i+j] == t[j] or s[i+j] == '?':
        count += 1
    if count == len(t):
      ok.append(i)
if len(ok) == 0:
  print("UNRESTORABLE")
  ch = False
else:
  for i in range(len(t)):
    t1[ok[0]+i] = t[i]
  for i in range(len(t)):
    t2[ok[-1]+i] = t[i]
if ch:
  for i in range(len(t1)):
    if t1[i] == '?':
      t1[i] = 'a'
    if t2[i] == '?':
      t2[i] = 'a'
  an1, an2 = "", ""
  for i in t1:
    an1 += i
  for i in t2:
    an2 += i
  print(min(an1, an2))

S = input()
T = input()

if len(S) < len(T):
    print('UNRESTORABLE')
    return
    

ind = None
for i in range(len(S)-len(T)+1):
    for j in range(len(T)):
        if S[i+j] == "?":
            continue
        elif S[i+j] == T[j]:
            continue
        else:
            break
    else:
        ind = i

if ind == None:
    print('UNRESTORABLE')
else:
    ans = list(S)
    for i in range(ind,ind+len(T)):
        ans[i] = T[i-ind]
    for i in range(len(ans)):
        if ans[i] == "?":
            ans[i] = "a"
    print("".join(ans))

S = input()
T = input()

l = len(S)
k = len(T)
f = 0


if k > l:
    f = 0
else:
    for i in reversed(list(range(0,l-k+1))):
        #print(i)
        for j in range(k):
            #print(S[i+j], T[j])
            if S[i + j] != T[j] and S[i + j] != "?":
                #print(i+j)
                break
            if j == k-1:
                f = 1
                s = i
        if f == 1:
            break

if f == 0:
    print("UNRESTORABLE")
else:
    S = S[:s] + T + S[s+k:]
    for i in range(l):
        if S[i] == "?":
            S = S[:i] + "a" + S[i+1:]
    print(S)


s = input()
t = input()
n = len(s)
m = len(t)
ans = []

for i in range(n-m+1):
  	#tと同じ文字数をsから抜き出す
    c = 0
    for j in range(m):
        if s[i+j] == '?' or s[i+j] == t[j]:
          	#sの文字が"?"またはt[j]と同じ場合
            c += 1
    if c == m:
      	#文字の変換
        s_ = s[0:i] + t + s[i+m:]
        s_ = s_.replace('?', 'a')
        ans.append(s_)
if len(ans)>0:
    print(sorted(ans)[0])
else:
    print('UNRESTORABLE')

import sys
import math
from collections import defaultdict
from collections import deque

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()


def main():
    S = SI()
    T = SI()
    ls = len(S)
    lt = len(T)
    R = []
    for i in range(ls-lt+1):
        SS = S[i:i+lt]
        is_ok = True
        for s, t in zip(SS, T):
            if s != "?" and s != t:
                is_ok = False
        if not is_ok:
            continue
        r = ""
        for j, s in enumerate(S):
            if j == i:
                r += T
            elif i < j < i+lt:
                pass
            elif s == "?":
                r += "a"
            else:
                r += s
        R.append(r)
    R.sort()
    if R:
        print(R[0])
    else:
        print("UNRESTORABLE")



def __starting_point():
    main()
__starting_point()

s = input()
t = input()

n = len(s)
m = len(t)

for i in range(n-m, -1, -1):
  x = s[i:i+m]
  for j in range(m+1):
    if j == m:
      print(((s[:i]+t+s[i+m:]).replace("?","a")))
      return
    if x[j] == "?": continue
    elif x[j] != t[j]: break
    
print("UNRESTORABLE")


s = input()
t: str = input()
n = len(s)
m = len(t)

for i in range(n-m, -1, -1):  #-1からn-m回、１ずつ引いていく
    tlike = s[i: i+m]
    if tlike[0] == t[0] or tlike[0] == "?":
        for j in range(m+1):
            if j == m:
                print((s[:i] + t + s[i + m:]).replace("?", "a"))
                return
            if tlike[j] == "?":
                continue
            elif tlike[j] != t[j]:
                break

print("UNRESTORABLE")

# 解説を読みながら自作

S = input()
T = input()

s_len = len(S)
t_len = len(T)

res = []

init_K = "?" * s_len
for i in range(s_len - t_len + 1):
    K = list(init_K[:i] + T + init_K[i + t_len:])
    # KをSにしたがって書き換えていく。書き換えられない→正解ではない
    for j in range(s_len):
        if S[j] == "?" or S[j] == K[j]:  # Sが"?"またはSとKが一致、書き換える必要なし
            pass
        elif K[j] == "?":  # Sが"?"ではなくてKが"?"、書き換える
            K[j] = S[j]
        else:  # それ以外、書き換えられない
            break
    else:  # breakしなかった
        # 辞書順で最小になるように、残ったKの"?"を"a"に変える
        res.append("".join(K).replace("?", "a"))

if res:
    res.sort()
    print((res[0]))
else:
    print("UNRESTORABLE")


S=str(input())
T=str(input())
ls=len(S)
lt=len(T)

ans=''
loc=None
for i in range(ls-lt,-1,-1):
  flag=0
  for j in range(lt):
    if not (S[i+j] == T[j] or S[i+j] == '?'):
      flag=1
      break
  if flag==0:
    loc=i
    break

if loc == None:
  print('UNRESTORABLE')
else:
  i=0
  while i<ls:
    if i==loc:
      ans += T
      i += lt
    elif S[i] == '?':
      ans += 'a'
      i += 1
    else:
      ans += S[i]
      i += 1
  print(ans)


s = input()
t = input()

n = len(s)
k = len(t)
for i in range(n - k, -1, -1):
    ok = True
    for j in range(k):
        if s[i + j] == '?' or s[i + j] == t[j]:
            continue
        else:
            ok = False
            break
    if ok:
        print((s[:i].replace('?', 'a') + t + s[i + k:].replace('?', 'a')))
        return
print('UNRESTORABLE')


S=input()
T=input()
N=len(S)
n=len(T)
ans=[]
for i in range(N-n+1):
    for j in range(n):
        if S[i+j]!=T[j] and S[i+j]!='?':
            break
    else:
        s=[]
        for j in range(i):
            if S[j]=='?':
                s.append('a')
            else:
                s.append(S[j])
        for j in range(i,i+n):
            s.append(T[j-i])
        for j in range(i+n,N):
            if S[j]=='?':
                s.append('a')
            else:
                s.append(S[j])
        ans.append(''.join(s))

if len(ans)==0:
    print("UNRESTORABLE")
else:
    ans.sort()
    print((ans[0]))


S = input()
T = input()

for i in range(len(S) - len(T)+1):
    target = S[len(S) - len(T) - i:len(S) - i]

    can_search = True
    for key in range(len(T)):
        if target[key] != '?':
            if target[key] != T[key]:
                can_search = False
                break

    if can_search:
        new_key = S[:len(S) - len(T) - i]
        new_key += T
        new_key += S[len(new_key):]
        print((new_key.replace('?', 'a')))
        return

print('UNRESTORABLE')


S = list(input())
T = list(input())
s = len(S)
t = len(T)
for i in range(s-t,-1,-1):
    ss = S[i:i+t]
    for j in range(t):
        if ss[j] != "?" and ss[j] != T[j]:
            break
    else:
        for j in range(t):
            if ss[j] == "?":
                S[i+j] = T[j]
        break
else:
    print("UNRESTORABLE")
    return
print("".join(S).replace("?","a"))

S = input()
T = input()

ls = len(S)
lt = len(T)
left = -1

for i in range(ls-lt+1):
    for j in range(lt):
        if S[i+j] != "?" and S[i+j] != T[j]:
            break
    else:
       left = i
if left == -1:
    ans = "UNRESTORABLE"
else:
    ans = S[:left]+T+S[left+lt:]
    ans = ans.replace("?", "a")
print(ans)

import sys

def accept_input():
    S = input()
    T = input()
    return S,T

S,T = accept_input()
fromhere = -1
for i in range(len(S)-len(T)+1):
    for j in range(len(T)):
        if S[i+j] == "?":
            continue
        elif S[i+j] == T[j]:
            continue
        elif S[i+j] != T[j]:
            break
    else:
        fromhere = i
if fromhere == -1:
    print("UNRESTORABLE")
    return
sd = ""
for i in range(len(S)):
    if i < fromhere:
        if S[i] == "?":
            sd += "a"
        else:
            sd += S[i]
    elif i >= fromhere+len(T):
        if S[i] == "?":
            sd += "a"
        else:
            sd += S[i]
    else:
        sd += T[i-fromhere]
print(sd)


s=input()
t=input()

s_l=len(s)
t_l=len(t)

ans=[]
for i in range(s_l-t_l+1):
  judge=True

  ts=list(s)
  for j in range(t_l):
    if ts[i+j]==t[j]:
      pass
    elif ts[i+j]=='?':
      ts[i+j]=t[j]
    else:
      judge=False
      break

    if judge and j==t_l-1:
      for k in range(s_l):
        if ts[k]=='?':
          ts[k]='a'
      ans.append(ts)

if ans:
  ans.sort()
  print(''.join(ans[0]))
else:
  print('UNRESTORABLE')

# -*- coding: utf-8 -*-
"""
Created on Mon Sep 28 02:20:36 2020

@author: liang
"""
S = input()
T = input()

S = S[::-1]
T = T[::-1]

res = list()

for i in range(len(S)-len(T)+1):
    flag = True
    for j in range(len(T)):
        if S[i+j] == "?" or S[i+j] == T[j]:
            continue
        else:
            flag = False
    if flag == True:
        ans = ""
        for k in range(len(S)):
            if i <= k <= i + len(T)-1:
                #print(T[k-i])
                ans += T[k-i]
            elif S[k] != "?":
                #print("B")
                ans += S[k]
            else:
                #print("C")
                ans += "a"
        ans = ans[::-1]
        print(ans)
        break
        #res.append(ans)
else:
    print("UNRESTORABLE")
"""
if res:
    res.sort()
    print(res[0])
else:
    print("UNRESTORABLE")
"""
#print(S)
#print(T)


s = list(input())
t = list(input())
ls =len(s)
lt = len(t)
s.reverse()
t.reverse()
for i in range(ls):
    for j in range(lt):
        if i + j >= ls:
            break
        if s[i+j] != '?' and s[i+j] != t[j]:
            break
    else:
        for j in range(lt):
            s[i+j] = t[j]
        s = [x if x != '?' else 'a' for x in s]
        s.reverse()
        ans = ''.join(s)
        break
else:
    ans = 'UNRESTORABLE'
print(ans)

S = input()
T = input()
anslist = []
for i in range(len(S)-len(T)+1):
    kouho = [0]*len(S)
    ok = 1
    for j in range(len(T)):
        if S[i+j] == T[j] or S[i+j] == "?":
            kouho[i+j] = T[j]
        else:
            ok = 0
            break
    if ok == 1:
        for k in range(len(S)):
            if kouho[k] == 0:
                if S[k] != "?":
                    kouho[k] = S[k]
                else:
                    kouho[k] = "a"
        kouho = ''.join(kouho)
        anslist.append(kouho)
if len(anslist) == 0:
    ans = "UNRESTORABLE"
else:
    anslist.sort()
    ans = anslist[0]
print(ans)


import re
Sd = input()
T = input()
Sdls = list(Sd)
Sdls.reverse()
Sdre = ''.join(Sdls)
Tls = list(T)
Tls.reverse()
Tre = ''.join(Tls)
st = -1
for i in range(0,len(Sd)-len(T)+1):
    f = 1
    for j in range(len(T)):
        if Tre[j] == Sdre[i+j] or Sdre[i+j] == '?':
            continue
        else:
            f = 0
            break
    if f == 1:
        st = i
        break
if st == -1:
    print('UNRESTORABLE')
else:
    Sdrels = list(Sdre)
    for j in range(len(T)):
        Sdrels[j+st] = Tre[j]
    for j in range(len(Sd)):
        if Sdrels[j] == '?':
            Sdrels[j] = 'a'
    ans = ''.join(reversed(Sdrels))
    print(ans)

s = input()
t = input()
lt = len(t)
ans = []
for i in range(len(s)-lt+1):
    cnt = 0
    n = 0
    while n < lt:
        if s[i+n] == '?':
            cnt += 1
        else:
            if s[i+n] == t[n]:
                cnt += 1
        n += 1
    if cnt == lt:
        ans.append(list(s[:i] + t + s[i+lt:]))
        # print(ans)
        # break

if len(ans) != 0:
    for a in ans:
        # print(a)
        for i in range(len(a)):
            if a[i] == '?':
                a[i] = 'a'
    ans.sort()
    print(*ans[0], sep='')

else:
    print('UNRESTORABLE')

S=input()
T=input()

lt=len(T)
ls=len(S)
if ls<lt:flg=0
else:
 for i in range(ls-lt,-1,-1):
  flg=1
  for j in range(i,i+lt):
    s=S[j]
    if s=='?' or s==T[j-i]: continue
    flg=0
    break
  if flg:break
if flg:
    print((S[0:i]+T+S[i+lt:ls]).replace('?','a'))
else:
    print('UNRESTORABLE')

import sys
#import string
#from collections import defaultdict, deque, Counter
#import bisect
#import heapq
#import math
#from itertools import accumulate
#from itertools import permutations as perm
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as combr
#from fractions import gcd
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

def solve():
    s = str(stdin.readline().rstrip())
    t = str(stdin.readline().rstrip())
    #A, B, C = map(int, stdin.readline().rstrip().split())
    #l = list(map(int, stdin.readline().rstrip().split()))
    #numbers = [[int(c) for c in l.strip().split()] for l in sys.stdin]
    #word = [stdin.readline().rstrip() for _ in range(n)]
    #number = [[int(c) for c in stdin.readline().rstrip()] for _ in range(n)]
    #zeros = [[0] * w for i in range(h)]
    anss = []
    for i in range(len(s)-len(t)+1):
        test = s[i:len(t)+i]
        flag = True
        for j in range(len(t)):
            if test[j] != "?" and test[j] != t[j]:
                flag = False
        if flag==True:
            ans = s[0:i] + t + s[i+len(t):]
            ans = ans.replace("?","a")
            anss.append(ans)
    if len(anss) == 0:
        print("UNRESTORABLE")
        return
    anss.sort()
    print((anss[0]))


def __starting_point():
    solve()

__starting_point()

S = input()
T = input()
len_S, len_T = len(S), len(T)
ans = []
for i in range(len_S-len_T+1):
	f = True
	for j in range(len_T):
		if S[i+j] != T[j] and S[i+j] != '?':
			f = False
			break
	if f:
		s = S[:i] + T + S[i+j+1:]
		ans.append(s.replace('?', 'a'))
if len(ans) == 0:
	print('UNRESTORABLE')
else:
	ans.sort()
	print(ans[0])

s = input()
t = input()
ns = len(s)
nt = len(t)

cand = []

for i in range(ns-nt+1):
    j = 0
    temps = list(s)
    f1 = True
    while j <= nt-1:
        if temps[i+j] == '?' or temps[i+j] == t[j]:
            temps[i+j] = t[j]
        else:
            f1 = False
            break
        j += 1
    if f1:
        temps = "".join(temps)
        cand.append(temps.replace('?', 'a'))

if len(cand) == 0:
    ans = 'UNRESTORABLE'
else:
    cand.sort()
    ans = cand[0]
print(ans)


S=input()
T=input()

ans_list=[]
for i in range(len(S)-len(T)+1):
    X=S[i:i+len(T)]
    isOK=True
    for j in range(len(T)):
        if X[j]=="?" or X[j]==T[j]:
            pass
        else:
            isOK=False
            break
    
    if isOK:
        ans=S[:i]+T+S[i+len(T):]
        
        ans=ans.replace('?','a')
        ans_list.append(ans)

if len(ans_list)<1:
    print("UNRESTORABLE")
else:
    ans_list.sort()
    print((ans_list[0]))


s=list(input())
t=list(input())
num=len(s)-len(t)
ans1=-1
for i in range(num+1):
    num1=0
    num2=num-i
    for j in range(len(t)):
        if s[num2+j]!=t[j] and s[num2+j]!="?":
            num1=1
            break
    if num1==0:
        ans1=num2
        break
if ans1==-1:
    print("UNRESTORABLE")
else:
    ans=""
    for i in range(len(t)):
        s[ans1+i]=t[i]
    for i in range(len(s)):
        if s[i]=="?":
            s[i]="a"
        ans+=s[i]
    print(ans)


import math

sd = list(input())
t = list(input())

dic = []

slen = len(sd)
tlen = len(t)
for i in range(slen - tlen + 1):
    for j in range(tlen):
        if not (t[j] == sd[i + j] or sd[i + j] == "?"):
            break
    else:
        s = sd[:i] + t + sd[i + tlen:]
        for k in range(len(s)):
            if s[k] == "?":
                s[k] = "a"
        dic.append("".join(s))

if len(dic) == 0:
    print("UNRESTORABLE")
    return
print(sorted(dic)[0])

S = input()
T = input()
ls = len(S)
lt = len(T)

unrestorable = 'z'*50
ans = unrestorable
for i in range(ls-lt+1):
    for j, t in enumerate(T):
        s = S[i+j]
        if s != t and s != '?':
            break
    else:
        key = (S[:i]+T+S[i+lt:]).replace('?', 'a')
        ans = min(ans, key)

print((ans if ans != unrestorable else 'UNRESTORABLE'))


import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return list(map(int,input().split()))
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 6)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")
al = "abcdefghijklmnopqrstuvwxyz"
AL = al.upper()

S = v()
T = v()
len_s = len(S)
len_t = len(T)
check = False
ans = []

if len_s<len_t:
    print("UNRESTORABLE")
    return

for i in range(len_s):
    if S[i] == "?":
        cnt += 1
        if cnt >= len_t:
            aaa = S.replace("?","a")
            ans.append(aaa[:i-len_t+1]+T+aaa[i+1:])
    elif S[i] in T:
        cnt = 0
        place = T.index(S[i])
        if len_s<len_t+i-place:
            break
        for j in range(i-place,len_t+i-place):
            if T[j-(i-place)] == S[j] or S[j] == "?":
                check = True
            else:
                check = False
                break
        if check:
            aaa = S.replace("?","a")
            ans.append(aaa[:i-place]+T+aaa[len_t+i-place:])
    else:
        cnt = 0

if len(ans)>0:
    ans.sort()
    print((ans[0]))
else:
    print("UNRESTORABLE")
        


s = list(input())
t = list(input())
s.reverse()
t.reverse()
l = len(t)
ld = len(s)-len(t)+1
for i in range(ld):
    cnt = 0
    for j in range(l):
        if s[j+i] == "?" or s[j+i] == t[j]:
            cnt += 1
    if cnt == l:
        ans = []
        for p in range(i):
            if s[p] == "?":
                ans.append("a")
            else:
               ans.append(s[p])
        for p in t:
            ans.append(p)
        for p in range(ld-i-1):
            if s[l+p+i] == "?":
                ans.append("a")
            else:
                ans.append(s[l+i+p])
        ans.reverse()
        for p in ans:
            print(p,end = "")
        break
            
else:
    print("UNRESTORABLE")

S = list(input())
T = input()
candidate = []

ans = True
for i in range(len(S)):
    flag = True
    for j in range(len(T)):
        if i + j >= len(S):
            flag = False
            break
        if S[i+j] == '?' or S[i+j] == T[j]:
            pass
        else:
            flag = False
            break
    if flag:
        candidate.append(i)
        ans = False

if ans:
    print('UNRESTORABLE')
    return

i = candidate[-1]
for tmp in range(i, i + len(T)):
    S[tmp] = T[tmp-i]


for i in range(len(S)):
    if S[i] == '?':
        S[i] = 'a'

print(''.join(S))

S=list(input())
T=list(input())

def match(s,t):
  for _s, _t in zip(s, t):
    if not (_s == _t or _s == '?'):
      return False
  return True
 
def convert(S):
  for i in range(len(S)):
    if S[i] == '?':
      S[i] = 'a'
  return S

def replace(S,T,off):
  for i in range(len(T)):
    S[off+i] = T[i]
  return S

pos = -1
for i in reversed(range(0,len(S)-len(T)+1)):
  if match(S[i:], T):
    pos = i
    break
    
if 0 <= pos:
  ans = S
  ans = replace(ans, T, pos)
  ans = convert(ans)
  print(*ans,sep="")
else:
  print('UNRESTORABLE')

import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    S_ = SS()
    T = SS()

    len_S = len(S_)
    len_T = len(T)

    # TはS'のなるべく右側にあるべき
    idx = -1
    for i in range(len_S - len_T, -1, -1):
        exists = True
        for j in range(len_T):
            if S_[i+j] != '?' and S_[i+j] != T[j]:
                exists = False
                break
        if exists:
            idx = i
            break

    if idx == -1:
        print('UNRESTORABLE')
    else:
        ans = list(S_)
        for i in range(len_S):
            if S_[i] == '?':
                if idx <= i < idx + len_T:
                    ans[i] = T[i-idx]
                else:
                    ans[i] = 'a'

        print((''.join(ans)))

def __starting_point():
    resolve()

__starting_point()

s_ = input()
t_ = input()
s = [c for c in s_]
t = [c for c in t_] 
n = len(s)
m = len(t)
for i in reversed(list(range(m-1, n))):
    replaced = 0
    if s[i]==t[-1] or s[i]=="?":
        k = i-1
        """
        if k+1<m-1:
            continue
        """
        replace = 1
        for j in reversed(list(range(m-1))):
            if s[k]==t[j] or s[k]=="?":
                if j==0:
                    replace=1
                    break
            else:
                replace = 0
                break
            k -= 1

        if replace:
            k = i
            for j in reversed(list(range(m))):
                s[k] = t[j]
                k -= 1
            replaced = 1
    if replaced:
        break
if n < m:
    replaced=0
if replaced:
    for i in range(n):
        if s[i]=="?":
            s[i]="a"
    print(("".join(s)))
else:
    print("UNRESTORABLE")


S = input()
T = input()
def match(s,t):
    for c,d in zip(s,t):
        if c == "?":
            continue
        elif c == d:
            continue
        else:
            return False
    return True
for i in range(len(S)-len(T), -1, -1):
    s = S[i:i+len(T)]
    if match(s, T):
        print((S[:i]+T+S[i+len(T):]).replace("?","a"))
        return
print("UNRESTORABLE")

S_p=input()
T=input()

k=[]
for i in range(len(S_p)-len(T)+1):
	S_sub = S_p[i:i+len(T)]
	if all(s in (t, "?") for s, t in zip(S_sub, T)):
		k.append(i)


if k:
	S=S_p[:k[-1]]+T+S_p[k[-1]+len(T):]
	print(S.replace("?", "a"))
else:
	print("UNRESTORABLE")

s = list(input())
t = list(input())
n = len(s)
m = len(t)
k = -1
for i in range(n-m+1):
    x = s[i:i+m]
    flg = True
    for j in range(m):
        if x[j] != '?' and x[j] != t[j]:
            flg = False
            break
    if flg:
        k = i
if k != -1:
    for i in range(k,k+m):
        s[i] = t[i-k]
    for i in range(n):
        if s[i] == '?':
            s[i] = 'a'
    print(''.join(s))
else:
    print('UNRESTORABLE')