Buggy python submission (verdict: Runtime Error):
S = input()
T = input()

moji = []

for i in range(len(S)):
    j = 0
    cnt = 0
    

    while j < len(T) and i+len(T)-1 < len(S):
        if S[i+j] == T[j] or S[i+j] == '?':
            cnt += 1

        else:
            break
        j += 1
    
    if cnt == len(T):
        moji0 = ''
        if i == 0: moji0 = T+S[i+len(T):len(S)]
        elif i+len(T) > len(S)-1: 
            moji0 = S[0:i]+T
        else:
            moji0 = S[0:i]+T+S[i+len(T):len(S)]

        
        moji1 = moji0.replace('?', 'a')
\
        moji.append(moji1)

    
print(min(moji) if moji != [] else "UNRESTORABLE")

Fixed submission:
S = input()
T = input()

moji = []

for i in range(len(S)):
    j = 0
    cnt = 0
    
    while j < len(T) and i+len(T)-1 < len(S):
        if S[i+j] == T[j] or S[i+j] == '?':
            cnt += 1

        else:
            break
        j += 1
    
    if cnt == len(T):
        moji0 = ''
        if i == 0: moji0 = T+S[i+len(T):len(S)]
        elif i+len(T) > len(S)-1: 
            moji0 = S[0:i]+T
        else:
            moji0 = S[0:i]+T+S[i+len(T):len(S)]

        
        moji1 = moji0.replace('?', 'a')
        moji.append(moji1)

print(min(moji) if moji != [] else "UNRESTORABLE")

Buggy python submission (verdict: Runtime Error):
S = input()
T = input()

moji = []

for i in range(len(S)):
    j = 0
    cnt = 0
    

    while j < len(T) and i+len(T)-1 < len(S):
        if S[i+j] == T[j] or S[i+j] == '?':
            cnt += 1

        else:
            break
        j += 1
    
    if cnt == len(T):
        moji0 = ''
        if i == 0: moji0 = T+S[i+len(T):len(S)]
        elif i+len(T) > len(S)-1: 
            moji0 = S[0:i]+T
        else:
            moji0 = S[0:i]+T+S[i+len(T):len(S)]

        
        moji1 = moji0.replace('?', 'a')
\
        moji.append(moji1)

    
print(min(moji))

Fixed submission:
S = input()
T = input()

moji = []

for i in range(len(S)):
    j = 0
    cnt = 0
    
    while j < len(T) and i+len(T)-1 < len(S):
        if S[i+j] == T[j] or S[i+j] == '?':
            cnt += 1

        else:
            break
        j += 1
    
    if cnt == len(T):
        moji0 = ''
        if i == 0: moji0 = T+S[i+len(T):len(S)]
        elif i+len(T) > len(S)-1: 
            moji0 = S[0:i]+T
        else:
            moji0 = S[0:i]+T+S[i+len(T):len(S)]

        
        moji1 = moji0.replace('?', 'a')
        moji.append(moji1)

print(min(moji) if moji != [] else "UNRESTORABLE")

Buggy python submission (verdict: Runtime Error):
S = input()
T = input()

for i in range(len(S)):
    j = 0
    cnt = 0
    moji = []

    while j < len(T) and i+len(T)-1 < len(S):
        if S[i+j] == T[j] or S[i+j] == '?':
            cnt += 1
    if cnt == len(T):
        moji0 = S[0:i]+T+S[i+len(T)]
        moji1 = moji0.replace('?', 'a')
        moji.append(moji1)

    
print(min(moji))

Fixed submission:
S = input()
T = input()

moji = []

for i in range(len(S)):
    j = 0
    cnt = 0
    
    while j < len(T) and i+len(T)-1 < len(S):
        if S[i+j] == T[j] or S[i+j] == '?':
            cnt += 1

        else:
            break
        j += 1
    
    if cnt == len(T):
        moji0 = ''
        if i == 0: moji0 = T+S[i+len(T):len(S)]
        elif i+len(T) > len(S)-1: 
            moji0 = S[0:i]+T
        else:
            moji0 = S[0:i]+T+S[i+len(T):len(S)]

        
        moji1 = moji0.replace('?', 'a')
        moji.append(moji1)

print(min(moji) if moji != [] else "UNRESTORABLE")

Buggy python submission (verdict: Runtime Error):
S = input()
T = input()

for i in range(len(S)):
    j = 0
    cnt = 0
    moji = []

    while j < len(T) and i+len(T)-1 < len(S):
        if S[i+j] == T[j] or S[i+j] == '?':
            cnt += 1
    if cnt == len(T):
        moji0 = S[0:i]+T+S[i+len(T)]
        moji1 = moji0.replace('?', 'a')
        moji.append(moji1)

    
print(min(moji))

Fixed submission:
S = input()
T = input()

moji = []

for i in range(len(S)):
    j = 0
    cnt = 0
    
    while j < len(T) and i+len(T)-1 < len(S):
        if S[i+j] == T[j] or S[i+j] == '?':
            cnt += 1

        else:
            break
        j += 1
    
    if cnt == len(T):
        moji0 = ''
        if i == 0: moji0 = T+S[i+len(T):len(S)]
        elif i+len(T) > len(S)-1: 
            moji0 = S[0:i]+T
        else:
            moji0 = S[0:i]+T+S[i+len(T):len(S)]

        
        moji1 = moji0.replace('?', 'a')
        moji.append(moji1)

print(min(moji) if moji != [] else "UNRESTORABLE")