Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03720 (python)

Fixed submission:

x = list(map(int, input().split()))
a=[input() for i in range(x[1])]
count=[]

for i in range(0,x[0]+2):
    count=count+[[0,i]]

for i in a:
    i=list(map(int, i.split()))
    count[i[0]][0]+=1
    count[i[1]][0]+=1
   
  
for i in range (1,x[0]+1):
    print(count[i][0])

Buggy submission (verdict: Runtime Error):
x = list(map(int, input().split()))
a=[input() for i in range(x[0])]
count=[]
for i in range(0,x[0]+2):
    count=count+[[0,i]]



for i in a:
    i=list(map(int, i.split()))
    count[i[0]][0]+=1
    count[i[1]][0]+=1
   
  
for i in range (1,x[0]+1):
    print(count[i][0])
Problem p03323 (python)

Fixed submission:
a,b=map(int,input().split())
if a<=8 and b<=8:
    print("Yay!")
else:
    print(":(")

Buggy submission (verdict: Runtime Error):
a,b=int(input().split())
if a<=8 and b<=8:
    print("Yay!")
else:
    print(":(")
Problem p03477 (python)

Fixed submission:
n=list(map(int,input().split()))
l=n[0]+n[1]
r=n[2]+n[3]
if l>r:
    print('Left')
elif l==r:
    print('Balanced')
else:
    print('Right')

Buggy submission (verdict: Runtime Error):
n,a,b=input().split()
nn=[0]*4
x=0
for i in range(1,n+1,1,):
    nn=len(i)
    y=nn[0]+nn[1]+nn[2]+nn[3]
    if (y>=a)and(y<=b):
        x=x+y
print(x)
Problem p03351 (python)

Fixed submission:
#coding : utf8

"""
@param {int}
@return {bool}
"""
def calcDistance(a,b,c,d):

    if( abs(a-c) <= d ):
        return True
    elif( abs(a-b) <= d and abs(b-c) <= d ):
        return True
    else:
        return False

if __name__ == '__main__':
    a,b,c,d = map(int, input().split())

    if(calcDistance(a,b,c,d)):
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
#coding : utf8

import math

"""
@param {int}
@return {int}
"""
def calcPow(X):
    num = int(math.sqrt(X))
    Max = 0

    for i in range(2,num+1):
        for j in range(2,num+1):
            if(pow(i,j) > X):
                if(pow(i,j-1) > Max):
                    Max = pow(i,j-1)
                    break
                break

    return Max


if __name__ == '__main__':
    X = int(input())

    print(calcPow(X))
Problem p03323 (python)

Fixed submission:
a,b = list(map(int, input().split()))
if a<=8 and b<=8: print('Yay!')
else: print(':(')

Buggy submission (verdict: Runtime Error):
if int(input())>=8 and int(input())>=8: print('Yay!')
else: print(':(')

Buggy submission (verdict: Runtime Error):
print('Yay!' if int(input())>=8 and int(input())>=8 else ':(')
Problem p03359 (python)

Fixed submission:
a,b = map(int, input().split())
if a > b:
    print(a-1)
else:
    print(a)

Buggy submission (verdict: Runtime Error):
h,w = map(int, input().split())
bord = [list(input()) for n in range(w)]
Answer = 0
for y in range(len(bord)):
    for x in range(len(bord[0])):
        if bord[y][x]=='#':
            if y==0:
                if x==0:
                    if bord[y][x+1]=='#': 
                        Answer=1;continue
                    if bord[y+1][x]=='#':
                        Answer=1;continue
                elif x==h-1:
                    if bord[y][x-1]=='#':
                        Answer=1
                        continue
                    if bord[y+1][x]=='#':
                        Answer=1;continue
                else:
                    if bord[y][x+1]=='#':
                        Answer=1;continue
                    if bord[y][x-1]=='#':
                        Answer=1;continue
                    if bord[y+1][x]=='#':
                        Answer=1;continue
            elif y==w-1:
                if x==0:
                    if bord[y][x+1]=='#':
                        Answer=1;continue
                    if bord[y-1][x]=='#':
                        Answer=1;continue
                elif x==h-1:
                    if bord[y][x-1]=='#':
                        Answer=1;continue
                    if bord[y-1][x]=='#':
                        Answer=1;continue
                else:
                    if bord[y][x+1]=='#':
                        Answer=1;continue
                    if bord[y][x-1]=='#':
                        Answer=1;continue
                    if bord[y-1][x]=='#':
                        Answer=1;continue
            elif x==0:
                if bord[y+1][x]=='#':
                    Answer=1;continue
                if bord[y-1][x]=='#':
                    Answer=1;continue
                if bord[y][x+1]=='#':
                    Answer=1;continue
            elif x==h-1:
                if bord[y+1][x]=='#':
                    Answer=1;continue
                if bord[y-1][x]=='#':
                    Answer=1;continue
                if bord[y][x-1]=='#':
                    Answer=1;continue
            else:
                if bord[y+1][x]=='#':
                    Answer=1;continue
                if bord[y-1][x]=='#':
                    Answer=1;continue
                if bord[y][x-1]=='#':
                    Answer=1;continue
                if bord[y][x+1]=='#':
                    Answer=1;continue
if Answer == 1:
    print('Yes')
else:
    print('No')
Problem p03369 (python)

Fixed submission:
n = list(input())
sum = 700
for a in n:
  if a == 'o':
  	sum += 100
print(sum)

Buggy submission (verdict: Runtime Error):
s = input().split()
sum = 700
for n in s:
  if n == 'o'
  	sum += 100
print(sum)
Problem p03377 (python)

Fixed submission:
a,b,x = list(map(int, input().split()))

if (a <= x) and (a+b >= x):
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
a,b,x = list(map(int, input().split()))

if (a >= x) and (a+b <= X):
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
a,b,c = lit(map(int, input().split()))
if a >= c and b >= c:
    print('YES')
else:
    print('NO')
Problem p03493 (python)

Fixed submission:
n = list(map(int, input()))
count = 0
for i in n: 
    if i == 1: count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n = list(map(int, input()))
count = 0
for i in range n: if i == 1: count += 1
print(count)
Problem p03679 (python)

Fixed submission:
x,a,b = list(map(int, input().split()))

if a>=b:
    print('delicious')
elif b-a <= x:
    print('safe')
else:
    print('dangerous')

Buggy submission (verdict: Runtime Error):
x,a,b = list(map(int, input().split()))

if a>=b:
    print('delicious')
elif b-a =< x:
    print('safe')
else:
    print('dangerous')
Problem p03360 (python)

Fixed submission:
L = list(map(int, input().split()))
K = int(input())

L.sort()

print(sum(L) + L[len(L) - 1] * (2 ** K - 1))

Buggy submission (verdict: Runtime Error):
L = list(map(int, input().split()))
K = int(input())

L.sort()

print(sum(L) + L[len(L)] * K)
Problem p03377 (python)

Fixed submission:
A, B, X = map(int, input().split())

if X - A >= 0 and A + B >= X:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
A, B, X = map(int, input().split())

if X - A > = 0 and A + B >= X:
    print("YES")
else:
    print("NO")
Problem p03493 (python)

Fixed submission:
print(input().count("1"))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

counter = 0

while True:
    exist_odd = False

    for i in range(n):
        if (a[i] % 2 != 0):
            exist_odd = True

    if exist_odd:
        break

    for i in range(n):
        a[i] = a[i] // 2

    counter += 1

print(counter)
Problem p03324 (python)

Fixed submission:
a, b = [int(x) for x in input().split()]

if b == 100:
    b = 101
    
print(100**a * b)

Buggy submission (verdict: Runtime Error):

if a == 0 and b == 100:
    print(101)
elif a == 1 and b == 100:
    print(10100)
elif a == 2 and b == 100:
    print(1010000)
else:
    print(100**a * b)
Problem p03861 (python)

Fixed submission:
#coding: UTF-8

import math


if __name__ == "__main__":
	data = list(map(int,input().split()))
	a = data[0]
	b = data[1]
	x = data[2]
	if a%x == 0:
		print((b-a)//x+1)
	else:
		if x > b:
			print("0")
		else: 
			if x < a:
				print((data[1]-(a+(x-a%x)))//data[2]+1)
			else:
				print((data[1]-data[2])//data[2]+1)

Buggy submission (verdict: Runtime Error):
#coding: UTF-8

import math


if __name__ == "__main__":
	a = int(input())
	b = int(input())
	x = int(input())
	if a%x == 0:
		print((b-a)//x+1)
	else:
		print((b-a)//x)
Problem p03328 (python)

Fixed submission:
#Stone Monument
a,b = map(int, input().split())
M = []
for i in range(1,1000,1):
	n = 1/2*i*(i+1)
	M.append(n)
n = b-a-1
print(int(M[n-1]-a))

Buggy submission (verdict: Runtime Error):
#Stone Monument
a,b = map(int, input().split())
M = []
ans = []
for i in range(1,1000,1):
	n = 1/2*i*(i+1)
	M.append(n)
for i in range(0,999,1):
	for j in range(0,1/2*i*(i+1),1):
		if (a + j == M[i]) and (b + j == M[i+1]):
			ans.append(j)

print(min(ans))

Buggy submission (verdict: Runtime Error):
#Stone Monument
a,b = map(int, input().split())
M = []
ans = []
for i in range(1,1000,1):
	n = 1/2*i*(i+1)
	M.append(n)
for i in range(0,999,1):
	for j in range(0,1000,1):
		if (a + j == M[i]) and (b + j == M[i+1]):
			ans.append(j)

print(min(ans))

Buggy submission (verdict: Runtime Error):
#Stone Monument
a,b = map(int, input().split())
M = []
ans = []
for i in range(1,1000,1):
	n = 1/2*i*(i+1)
	M.append(n)
for i in range(0,999,1):
	for j in range(0,999,1):
		if (M[i] - j == a) and (M[i+1] - j == b):
			ans.append(j)

print(max(ans))
Problem p03337 (python)

Fixed submission:
#Add Sub Mul

#入力
A,B = map(int,input().split())

#出力
print(max(A+B,A-B,A*B))

Buggy submission (verdict: Runtime Error):
#Attention

#ライブラリ
import copy

#入力
N = int(input())
S = list(input())
ans = []
#計算
for i in range(1,N-1,1):
	S_hidari = copy.copy(S[0:i])
	S_migi = copy.copy(S[i+1:N])
	if i == 1:
		ans.append(S_hidari.count('W')-1+S_migi.count('E'))
		break
	if i == N-2:
		ans.append(S_hidari.count('W')+S_migi.count('E')-1)
		break
	ans.append(S_hidari.count('W')+S_migi.count('E'))
	

print(min(ans))
Problem p03338 (python)

Fixed submission:
#Cut and Count

#ライブラリ
import copy

#入力
N = int(input())
S = list(input())
ans = []
#計算
for j in range(1,N-1,1):
	counter = 0
	S_hidari = []
	S_migi = []
	S_hidari = set(copy.copy(S[0:j]))
	S_migi = set(copy.copy(S[j:N]))
	for s_hidari in S_hidari:
		for s_migi in S_migi:
			if s_hidari == s_migi:
				counter += 1
	ans.append(counter)

#出力
if N == 2:
	if S[0] == S[1]:
		print("1")
	else:
		print("0")
	exit()
print(max(ans))

Buggy submission (verdict: Runtime Error):
#Cut and Count

#ライブラリ
import copy

#入力
N = int(input())
S = list(input())
ans = []
#計算
for j in range(1,N-1,1):
	counter = 0
	S_hidari = []
	S_migi = []
	S_hidari = set(copy.copy(S[0:j]))
	S_migi = set(copy.copy(S[j:N]))
	for s_hidari in S_hidari:
		for s_migi in S_migi:
			if s_hidari == s_migi:
				counter += 1
	ans.append(counter)

#出力
print(max(ans))
Problem p03359 (python)

Fixed submission:
#Day of Takahashi

#入力
a, b = map(int, input().split())

#計算
if a > b:
	ans = a-1

if a <= b:
	ans = a

#出力
print("{}".format(ans))

Buggy submission (verdict: Runtime Error):
#Grid Repainting 2

#初期化
S = []
p = []
flag = True

#入力
H,W = map(int, input().split())
for i in range(W):
	s = input()
	s_list = list(s)
	S.append(s_list)

#計算
for i in range(0, W-1, 1):
	for j in range(0, H-1, 1):
		if S[i][j] == "#" and S[i+1][j] == "." and S[i][j+1] == "."  and S[i-1][j] == "." and S[i][j-1] == "." :
			flag = False
		

#出力
if flag == True:
	print("Yes")

else:
	print("No")

Buggy submission (verdict: Runtime Error):
#Grid Repainting 2

#初期化
S = []
p = []
flag = True

#入力
H,W = map(int, input().split())
for i in range(W):
	s = input()
	s_list = list(s)
	S.append(s_list)

#計算
for i in range(0, H-1, 1):
	for j in range(1, W-1, 1):
		if S[i][j] == "#" and S[i+1][j] == "." and S[i][j+1] == "."  and S[i-1][j] == "." and S[i][j-1] == "." :
			flag = False
		

#出力
if flag == True:
	print("Yes")

else:
	print("No")

Buggy submission (verdict: Runtime Error):
#Day of Takahashi

#入力
a, b = map(int, input().split())

#計算
if a > b:
	ans = a-1

if a < b:
	ans = a

#出力
print("{}".format(ans))

Buggy submission (verdict: Runtime Error):
#Day of Takahashi

#入力
a, b = map(int, input().split())

#計算
if a > b:
	ans = b

if a < b:
	ans = a

#出力
print("{}".format(ans))
Problem p03352 (python)

Fixed submission:
x = int(input())
arr = [1]
for i in range(2,32):
    multi = 2
    while i**multi <= x:
        arr.append(i**multi)
        multi += 1
print(max(arr))

Buggy submission (verdict: Runtime Error):
x = int(input())
arr = []
for i in range(2,32):
    multi = 2
    while i**multi <= x:
        arr.append(i**multi)
        multi += 1
print(max(arr))
Problem p03471 (python)

Fixed submission:
n,y = map(int,input().split())

for i in range(n+1):
    for j in range(n+1):
        k = n - i - j
        if (10000 * i + 5000 * j + 1000 * k) == y and k >= 0:
            print(i,j,k)
            exit()
print('-1 -1 -1')

Buggy submission (verdict: Runtime Error):
n,y = map(int,input().split())

for i in range(n+1):
    for j in range(n+1):
        k = n - i - j
        if 10000 * i + 5000 * j + 1000 * k == y and y >= 0:
            print(i,j,k)
            exit()
print('-1 -1 -1'):
Problem p03587 (python)

Fixed submission:
s = input()
print(s.count("1"))

Buggy submission (verdict: Runtime Error):
 s = input()
print(s.count("1"))
Problem p03605 (python)

Fixed submission:
n = input()
if "9" in n:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
arr = {}
for i in range(n):
    num = int(input())
    if num in arr:
        arr.remove(num)
    else:
        arr.add(num)
print(len(arr))
Problem p03659 (python)

Fixed submission:
n = int(input())
arr = list(map(int,input().split()))
sum_arr = sum(arr)
ans=[]
x = 0
for i in range(n-1):
    x += arr[i]
    y = sum_arr - x
    ans.append(abs(x - y))
print(min(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
arr = input().split()
ans = []
for i in range(n):
    arr[i] = int(arr[i])
x = 0
y = sum(arr)
for i in range(n):
    if x <= y:
        x += arr[i]
        y -= arr[i]
        ans.append(x - y)
ans = map(abs,ans)
print(min(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
arr = input().split()
ans = []
for i in range(n):
    arr[i] = int(arr[i])
x = 0
y = sum(arr)
for i in range(n):
    if x <= y:
        x += arr[i]
        y -= arr[i]
        ans.append(abs(x - y))
print(min(ans))
Problem p03479 (python)

Fixed submission:
import math
import itertools
import heapq
from sys import stdin, stdout, setrecursionlimit
from bisect import bisect, bisect_left, bisect_right
from collections import defaultdict, deque


# d = defaultdict(lambda: 0)
# setrecursionlimit(10**7)
# inf = float("inf")


##### stdin ####
def LM(t, r): return list(map(t, r))
def R(): return stdin.readline()
def RS(): return R().split()
def I(): return int(R())
def F(): return float(R())
def LI(): return LM(int,RS())
def LF(): return LM(float,RS())
def ONE_SL(): return list(input())
def ONE_IL(): return LM(int, ONE_SL())
def ALL_I(): return map(int, stdin)
def ALL_IL(): return LM(int,stdin)

##### tools #####
def ap(f): return f.append
def pll(li): print('\n'.join(LM(str,li)))
def pljoin(li, s): print(s.join(li))

##### main #####



def main():
	x,y = LI()

	ans=0
	while x<=y:
		x*=2
		ans+=1
		
	print(ans)

if __name__ == '__main__':
	main()

Buggy submission (verdict: Runtime Error):
import math
import itertools
import heapq
from sys import stdin, stdout, setrecursionlimit
from bisect import bisect, bisect_left, bisect_right
from collections import defaultdict, deque


# d = defaultdict(lambda: 0)
# setrecursionlimit(10**7)
# inf = float("inf")


##### stdin ####
def LM(t, r): return list(map(t, r))
def R(): return stdin.readline()
def RS(): return R().split()
def I(): return int(R())
def F(): return float(R())
def LI(): return LM(int,RS())
def LF(): return LM(float,RS())
def ONE_SL(): return list(input())
def ONE_IL(): return LM(int, ONE_SL())
def ALL_I(): return map(int, stdin)
def ALL_IL(): return LM(int,stdin)

##### tools #####
def ap(f): return f.append
def pll(li): print('\n'.join(LM(str,li)))
def pljoin(li, s): print(s.join(li))

##### main #####



def main():
	x,y = LI()

	ans=
	while x<=y:
		x*=2
		ans+=1
		
	print(ans)

if __name__ == '__main__':
	main()
Problem p03546 (python)

Fixed submission:
from heapq import heappush, heappop

def dijkstra(adjList, s):
    num = len(adjList)
    dist = [float("INF") for i in range(10)]
    queue = []
    heappush(queue,(0,s))
    dist[s] = 0
    
    while queue != []:
        v_cost, v = heappop(queue)
        if dist[v] < v_cost:
            continue
        for u_cost, u in adjList[v]:
            if u != v and u_cost + dist[v] < dist[u]:
                dist[u] = u_cost + dist[v]
                heappush(queue, (dist[u], u))
    return dist


from sys import stdin
def IL():return list(map(int, stdin.readline().split()))

h,w = IL()
G = [[] for i in range(10)]

for i in range(10):
    l = IL()
    for j in range(10):
        G[i].append((l[j],j))


ans = 0
memo={}
for i in range(h):
    for i in IL():
        if abs(i) == 1:
          pass
        elif i in memo:
          ans += memo[i]
        else:
            t = dijkstra(G, i)[1] 
            memo[i] = t
            ans += t

print(ans)

Buggy submission (verdict: Runtime Error):
from heapq import heappush, heappop

def dijkstra(adjList, s):
    num = len(adjList)
    dist = [float("INF") for i in range(10)]
    queue = []
    heappush(queue,(0,s))
    dist[s] = 0
    
    while queue != []:
        v_cost, v = heappop(queue)
        if dist[v] < v_cost:
            continue
        for u_cost, u in adjList[v]:
            if u != v and u_cost + dist[v] < dist[u]:
                dist[u] = u_cost + dist[v]
                heappush(queue, (dist[u], u))
    return dist


from sys import stdin
def IL():return list(map(int, stdin.readline().split()))

h,w = IL()
G = [[] for i in range(10)]

for i in range(10):
    l = IL()
    for j in range(10):
        G[i].append((l[j],j))


dist = dijkstra(G, 8)
ans = 0
memo={}
for i in range(h):
    for i in IL():
        if abs(i) == 1:
          pass
        elif i in memo:
          ans += memo[i]
        else:
            t = dijkstra(G, i)[1] 
            memo[i] = t
            ans += t

print(ans)from heapq import heappush, heappop

def dijkstra(adjList, s):
    num = len(adjList)
    dist = [float("INF") for i in range(10)]
    queue = []
    heappush(queue,(0,s))
    dist[s] = 0
    
    while queue != []:
        v_cost, v = heappop(queue)
        if dist[v] < v_cost:
            continue
        for u_cost, u in adjList[v]:
            if u != v and u_cost + dist[v] < dist[u]:
                dist[u] = u_cost + dist[v]
                heappush(queue, (dist[u], u))
    return dist


from sys import stdin
def IL():return list(map(int, stdin.readline().split()))

h,w = IL()
G = [[] for i in range(10)]

for i in range(10):
    l = IL()
    for j in range(10):
        G[i].append((l[j],j))


dist = dijkstra(G, 8)
ans = 0
memo={}
for i in range(h):
    for i in IL():
        if abs(i) == 1:
          pass
        elif i in memo:
          ans += memo[i]
        else:
            t = dijkstra(G, i)[1] 
            memo[i] = t
            ans += t

print(ans)
Problem p03555 (python)

Fixed submission:
def main():
	c1 = input()
	c2 = input()
	
	if c1[0] == c2[-1] and c1[1] == c2[1] and c1[-1] == c2[0]:
	    print("YES")
	else:
	    print("NO")
        
if __name__ == "__main__": main()

Buggy submission (verdict: Runtime Error):
from sys import stdin
def readLine_int_list():return list(map(int, stdin.readline().split()))


def main():
	c1 = readLine_int_list()
	c2 = readLine_int_list()
	if c1[0] == c2[-1] and c1[1] == c2[1] and c1[-1] == c2[0]:
		print("YES")
	else:
		print("NO")
        
if __name__ == "__main__": main()

Buggy submission (verdict: Runtime Error):
from sys import stdin
def readLine_int_list():return list(map(int, stdin.readline().split()))


def main():
	c1 = readLine_int_list()
	c2 = readLine_int_list()
	
	if c1[0] == c2[-1] and c1[1] == c2[1] and c1[-1] == c2[0]:
	    print("YES")
    else:
        print("NO")
        
if __name__ == "__main__": main()
Problem p03565 (python)

Fixed submission:
from sys import stdin, stdout
from collections import defaultdict
def readLine_int_list():return list(map(int, stdin.readline().split()))
def readLine_int_list_reverse(): return list(map(int, stdin.readline().split())).reverse()
def readAll_int(): return list(map(int, stdin))
def readLine_str_list():return list(map(str, stdin.readline().split()))
def readAll_str(): return list(map(str, stdin))

import re

def main():
	_s = input()
	t = input()
	pattern=""
	for i in t:
	    pattern += "[?{}]".format(i)
	l=[]
	ans = ""
	f = False
	ff = False
	for i in range(len(_s)):
	    if _s[i] == '?' or _s[i] == t[0]:
	        tmp = _s[i:i+len(t)]
	        match = re.match(pattern , tmp)
	        if match:
	            f = True
	            if _s[i] == t:
	                ans += _s[i]
	                ff = True
	            else:
	                ans += 'X'
	        else:
	            ans += 'a'
	    else:
	        ans += _s[i]
	    
# 	print(ans)
	for i in range(len(ans)):
	    if ans[i] == "X":
	       _ans = [_ for _ in ans]
	       
	       if ff:
	           l.append(''.join(_ans).replace("X","a"))
	       else:
	           _ans[i:i+len(t)] = t
	           for i in range(len(_ans)):
	               if _s[i] != '?':
	                   _ans[i] = _s[i]
	           l.append(''.join(_ans).replace("X","a"))
	       
	if f:
	    ans = ''.join(min(l))
	    print(ans)
	else:
	    print("UNRESTORABLE")
	    
if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
from sys import stdin, stdout
from collections import defaultdict
def readLine_int_list():return list(map(int, stdin.readline().split()))
def readLine_int_list_reverse(): return list(map(int, stdin.readline().split())).reverse()
def readAll_int(): return list(map(int, stdin))
def readLine_str_list():return list(map(str, stdin.readline().split()))
def readAll_str(): return list(map(str, stdin))

import re

def main():
	_s = input()
	t = input()
	pattern=""
	for i in t:
	    pattern += "[?{}]".format(i)

	ans = ""
	f = False
	for i in range(len(_s)):
	    if _s[i] == '?' or _s[i] == t[0]:
	        tmp = _s[i:i+len(t)]
	        match = re.match(pattern , tmp)
	        if match:
	            f = True
	            ans += 'X'
	        else:
	            ans += 'a'
	    else:
	        ans += _s[i]
	
	
	for i in range(len(ans)):
	    if ans[i] == "X":
	       _ans = [_ for _ in ans]
	       _ans[i:i+len(t)] = t
	       for i in range(len(_ans)):
	           if _ans[i] == "X":
	               _ans[i] = 'a'
	       
	ans = ''.join(_ans)
	if f:
	    print(ans)
	else:
	    print("UNRESTORABLE")
	    
if __name__ == "__main__":
    main()