Buggy python submission (verdict: Runtime Error):
s = input()[::-1]
t = input()[::-1]
for i,c in enumerate(s):
  if (c == t[0] or c == '?') and (i+len(t) < len(s)-1):
    for j in range(len(t)):
      if t[j] != s[i+j] and s[i+j] != '?':
        break
    else:
      for j in range(len(t)):
        s[i+j] =  t[j]
      print(s.replace('?', 'a')[::-1])
      break
else:
  print('UNRESTORABLE')



Fixed submission:
s = input()[::-1]
t = input()[::-1]
for i,c in enumerate(s):
  if (c == t[0] or c == '?') and (i+len(t) < len(s)+1):
    for j in range(len(t)):
      if t[j] != s[i+j] and s[i+j] != '?':
        break
    else:
      str_list = list(s)
      for j in range(len(t)):
        str_list[i+j] =  t[j]
      s = ''.join(str_list)
      print(s.replace('?', 'a')[::-1])
      break
else:
  print('UNRESTORABLE')

Buggy python submission (verdict: Runtime Error):
s = input()[::-1]
t = input()[::-1]
for i,c in enumerate(s):
  if c == t[0] and (i+len(t) < len(s)):
    for j in range(len(t)):
      if t[j] != s[i+j] and s[i+j] != '?':
        break
    else:
      for j in range(len(t)):
        s[i+j] =  t[j]
      print(s.replace('?', 'a')[::-1])
      break
else:
  print('UNRESTORABLE')



Fixed submission:
s = input()[::-1]
t = input()[::-1]
for i,c in enumerate(s):
  if (c == t[0] or c == '?') and (i+len(t) < len(s)+1):
    for j in range(len(t)):
      if t[j] != s[i+j] and s[i+j] != '?':
        break
    else:
      str_list = list(s)
      for j in range(len(t)):
        str_list[i+j] =  t[j]
      s = ''.join(str_list)
      print(s.replace('?', 'a')[::-1])
      break
else:
  print('UNRESTORABLE')

Buggy python submission (verdict: Runtime Error):
s = input()[::-1]
t = input()[::-1]
for i,c in enumerate(s):
  if c == t[0] and (i+len(t) < len(s)):
    for j in range(len(t)):
      if t[j] != s[i+j] and s[i+j] != '?':
        break
    else:
      for j in range(len(t)):
        s[i+j] =  t[j]
      print(s.replace('?', 'a')[;;-1])
      break
else:
  print('UNRESTORABLE')



Fixed submission:
s = input()[::-1]
t = input()[::-1]
for i,c in enumerate(s):
  if (c == t[0] or c == '?') and (i+len(t) < len(s)+1):
    for j in range(len(t)):
      if t[j] != s[i+j] and s[i+j] != '?':
        break
    else:
      str_list = list(s)
      for j in range(len(t)):
        str_list[i+j] =  t[j]
      s = ''.join(str_list)
      print(s.replace('?', 'a')[::-1])
      break
else:
  print('UNRESTORABLE')

Buggy python submission (verdict: Runtime Error):
s = input()[::-1]
t = input()[::-1]
for i,c in enumerate(s):
  if c == t[0] and (i+len(t) < len(s)):
    for j in range(len(t)):
      if t[j] != s[i+j] and s[i+j] != '?':
        break
    else:
      for j in range(len(t)):
        s[i+j] =  t[j]
      print(s.replace('?', 'a'))
      break
else:
  print('UNRESTORABLE')



Fixed submission:
s = input()[::-1]
t = input()[::-1]
for i,c in enumerate(s):
  if (c == t[0] or c == '?') and (i+len(t) < len(s)+1):
    for j in range(len(t)):
      if t[j] != s[i+j] and s[i+j] != '?':
        break
    else:
      str_list = list(s)
      for j in range(len(t)):
        str_list[i+j] =  t[j]
      s = ''.join(str_list)
      print(s.replace('?', 'a')[::-1])
      break
else:
  print('UNRESTORABLE')

Buggy python submission (verdict: Runtime Error):
s = input()[::-1]
t = input()[::-1]
for i,c in enumerate(s):
  if c == t[0]:
    for j in range(len(t)):
      if t[j] != s[i+j] and s[i+j] != '?':
        break
    else:
      for j in range(len(t)):
        s[i+j] =  t[j]
print(s.replace('?', 'a'))

Fixed submission:
s = input()[::-1]
t = input()[::-1]
for i,c in enumerate(s):
  if (c == t[0] or c == '?') and (i+len(t) < len(s)+1):
    for j in range(len(t)):
      if t[j] != s[i+j] and s[i+j] != '?':
        break
    else:
      str_list = list(s)
      for j in range(len(t)):
        str_list[i+j] =  t[j]
      s = ''.join(str_list)
      print(s.replace('?', 'a')[::-1])
      break
else:
  print('UNRESTORABLE')