Buggy python submission (verdict: Runtime Error):
s = str(input())
t = str(input())
lst = []
i= 0
for ss in range(len(s)-len(t)+1):
  flg = 1
  i= 0
  for tt in range(len(t)):
    now = ss + tt
    if s[now] == t[tt] or s[now] == '?':
      pass
    else:
      flg = 0
  if flg:
    ns = list(s)
    ns[ss:now+1] = list(t)
    lst.append(("").join(ns))
if lst:
  lst = [_.replace('?','a') for _ in lst]
  sort(lst)
  print(lst[0])

else:
  print('UNRESTORABLE')


Fixed submission:
s = str(input())
t = str(input())
lst = []
i= 0
for ss in range(len(s)-len(t)+1):
  flg = 1
  i= 0
  for tt in range(len(t)):
    now = ss + tt
    if s[now] == t[tt] or s[now] == '?':
      pass
    else:
      flg = 0
  if flg:
    ns = list(s)
    ns[ss:now+1] = list(t)
    lst.append(("").join(ns))
if lst:
  lst = [_.replace('?','a') for _ in lst]
  lst.sort()
  print(lst[0])

else:
  print('UNRESTORABLE')

Buggy python submission (verdict: Runtime Error):
s = str(input())
t = str(input())
lst = []
i= 0
for ss in range(len(s)-len(t)+1):
  flg = 1
  i= 0
  for tt in range(len(t)):
    now = ss + tt
    print(now)
    if s[now] == t[tt] or s[now] == '?':
      pass
    else:
      flg = 0
  if flg:
    print(ss, ss+tt+1)
    print(s[ss:ss+tt+1])
    ns = list(s)
    ns[ss:now+1] = list(t)
    lst.append(("").join(ns))
if lst:
  lst = [_.replace('?','a') for _ in lst]
  sort(lst)
  print(lst[0])

else:
  print('UNRESTORABLE')
print(lst)

Fixed submission:
s = str(input())
t = str(input())
lst = []
i= 0
for ss in range(len(s)-len(t)+1):
  flg = 1
  i= 0
  for tt in range(len(t)):
    now = ss + tt
    if s[now] == t[tt] or s[now] == '?':
      pass
    else:
      flg = 0
  if flg:
    ns = list(s)
    ns[ss:now+1] = list(t)
    lst.append(("").join(ns))
if lst:
  lst = [_.replace('?','a') for _ in lst]
  lst.sort()
  print(lst[0])

else:
  print('UNRESTORABLE')

Buggy python submission (verdict: Runtime Error):
import sys
s = str(input())
t = str(input())
lst = []
i= 0
if len(s) < len(t):
  print('UNRESTORABLE')
  sys.exit()
  
else:
  for _ in range(len(s)):
    if s[_] == t[i] or s[_] == '?':
        i += 1       
    else:   
        i = 0
    if i == len(t):
      pt = _ - i + 1    
      s = s.replace(s[pt:_ + 1],t)
      lst.append(s)

if lst:
  lst = [_.replace('?','a') for _ in lst]
  sorted(lst)
  print(lst[0])

else:
  print('UNRESTORABLE')

Fixed submission:
s = str(input())
t = str(input())
lst = []
i= 0
for ss in range(len(s)-len(t)+1):
  flg = 1
  i= 0
  for tt in range(len(t)):
    now = ss + tt
    if s[now] == t[tt] or s[now] == '?':
      pass
    else:
      flg = 0
  if flg:
    ns = list(s)
    ns[ss:now+1] = list(t)
    lst.append(("").join(ns))
if lst:
  lst = [_.replace('?','a') for _ in lst]
  lst.sort()
  print(lst[0])

else:
  print('UNRESTORABLE')

Buggy python submission (verdict: Runtime Error):
s = str(input())
t = str(input())
lst = []
i= 0
flg = 1
for _ in range(len(s)):
    if s[_] == t[i] or s[_] == '?':
        i += 1       
    else:   
        i = 0
    if i == len(t):
      pt = _ - i + 1    
      s = s.replace(s[pt:_ + 1],t)
      lst.append(s)

if lst:
  lst = [_.replace('?','a') for _ in lst]
  sorted(lst)
  print(lst[0])

else:
  print('UNRESTORABLE')

Fixed submission:
s = str(input())
t = str(input())
lst = []
i= 0
for ss in range(len(s)-len(t)+1):
  flg = 1
  i= 0
  for tt in range(len(t)):
    now = ss + tt
    if s[now] == t[tt] or s[now] == '?':
      pass
    else:
      flg = 0
  if flg:
    ns = list(s)
    ns[ss:now+1] = list(t)
    lst.append(("").join(ns))
if lst:
  lst = [_.replace('?','a') for _ in lst]
  lst.sort()
  print(lst[0])

else:
  print('UNRESTORABLE')