Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
while True:
    a,b=map(int,input().split())
    if a==0 and b==0:break
    for i in range(H):
    	for j in range(W):
    		if (i + j)%2 == 0:print('#',end="")
    		else:print(".",end="")
    	print("")
    print("")


Fixed submission:
while True:
    a,b=map(int,input().split())
    if a==0 and b==0:break
    for i in range(a):
    	for j in range(b):
    		if (i + j)%2 == 0:print('#',end="")
    		else:print(".",end="")
    	print("")
    print("")
Buggy python submission (verdict: Runtime Error):

n = int(input())

c = [0]*(n+1)
c[0],c[1] = map(int,input().split())

for i in range(2,n+1):
    c[i] = int(input().split()[1])

dp = [[sys.maxsize]*(n+1) for i in range(n+1)]

for i in range(1,n+1):
    dp[i][i] = 0

for l in range(2,n+1) :#length of chain j-i+1
    for i in range(1,n-l+2):
        j = i +l - 1:
        for k in range(i,j):
            dp[i][j] = min(dp[i][j],dp[i][k]+ dp[k+1][j]+c[i-1]*[k]*c[j])


print(dp[1][n])

Fixed submission:
import sys

n = int(input())

c = [0]*(n+1)
c[0],c[1] = map(int,input().split())

for i in range(2,n+1):
    c[i] = int(input().split()[1])

dp = [[sys.maxsize]*(n+1) for i in range(n+1)]

for i in range(1,n+1):
    dp[i][i] = 0

for l in range(2,n+1) :#length of chain j-i+1
    for i in range(1,n-l+2):
        j = i +l - 1
        for k in range(i,j):
            dp[i][j] = min(dp[i][j],dp[i][k]+ dp[k+1][j]+c[i-1]*c[k]*c[j])


print(dp[1][n])
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())

l = []
for i in range(n):
    d = int(input())
    l.append(d)

p = max(l)
while True:
    sm_k = 0
    k_no = 1
    for li in l:
        if sm_k + li > p:
            k_no += 1
            sm_k = li
        else:
            sm_k += li

    # print(p, k_no)
    if k_no <= k:
        print(p)
        break

    p += 1



Fixed submission:
MAX_P = 100000 * 10000

n, k = map(int, input().split())
w = list()
for _ in range(n):
    w.append(int(input()))


# k台のトラックに、積載量Pでいくつ荷物が載せられるか
# 0 <= r <= n
def check(p):
    k_no = 1
    tmp = 0
    for i, wi in enumerate(w):
        if wi > p:
            return i
        if tmp + wi > p:
            if k_no == k:
                return i
            else:
                k_no += 1
                tmp = wi
        else:
            tmp += wi
    return len(w)


def solve():
    left = 1
    right = MAX_P

    while right - left > 1:
        mid = (left + right) // 2
        v = check(mid)  # v個載せられる
        if v < n:
            left = mid
        else:
            right = mid

    # print("left", left)
    # print("right", right)
    if check(left) >= n:
        return left
    else:
        return right

# for i in range(10):
#     print(i, check(i))

print(solve())

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())

l = []
for i in range(n):
    d = int(input())
    l.append(d)

p = max(l)
while True:
    sm_k = 0
    k_no = 1
    for li in l:
        if sm_k + li > p:
            k_no += 1
            if k_no > k:
                break
            sm_k = li
        else:
            sm_k += li

    # print(p, k_no)
    if k_no <= k:
        print(p)
        break

    p += 1



Fixed submission:
MAX_P = 100000 * 10000

n, k = map(int, input().split())
w = list()
for _ in range(n):
    w.append(int(input()))


# k台のトラックに、積載量Pでいくつ荷物が載せられるか
# 0 <= r <= n
def check(p):
    k_no = 1
    tmp = 0
    for i, wi in enumerate(w):
        if wi > p:
            return i
        if tmp + wi > p:
            if k_no == k:
                return i
            else:
                k_no += 1
                tmp = wi
        else:
            tmp += wi
    return len(w)


def solve():
    left = 1
    right = MAX_P

    while right - left > 1:
        mid = (left + right) // 2
        v = check(mid)  # v個載せられる
        if v < n:
            left = mid
        else:
            right = mid

    # print("left", left)
    # print("right", right)
    if check(left) >= n:
        return left
    else:
        return right

# for i in range(10):
#     print(i, check(i))

print(solve())
Buggy python submission (verdict: Runtime Error):
i=1
while True:
    n=int(input())
    i++
    print(f'Case {i}: {n}')



Fixed submission:
i=1
while True:
    x=int(input())
    if(x==0):
        break
    print(f"Case {i}: {x}")
    i+=1

Buggy python submission (verdict: Runtime Error):
i=1
while True:
    n=int(input())
    i++
    print(f'Case {i}: {x}')



Fixed submission:
i=1
while True:
    x=int(input())
    if(x==0):
        break
    print(f"Case {i}: {x}")
    i+=1

Buggy python submission (verdict: Runtime Error):
i=1
while True:
    x=int(input())
    if(x==0):
        break
    print(f"Case {i}: {x}")
    i++



Fixed submission:
i=1
while True:
    x=int(input())
    if(x==0):
        break
    print(f"Case {i}: {x}")
    i+=1
Buggy python submission (verdict: Runtime Error):
while True:
    input=input()
    a,b=map(int,input.split())
    if a==b==0:
        break
    if a<b:
        print(f"{a} {b}")
    else:
        print(f"{b} {a}")
    


Fixed submission:
while True:
    a,b=map(int,input().split())
    if (a==b):
        if (a==0):
            break
    if (a<b):
        print(f"{a} {b}")
    else:
        print(f"{b} {a}")

Buggy python submission (verdict: Runtime Error):
while True:
    input=input()
    a,b=map(int,input.split())
    if (a==b):
        if (a==0):
            break
    if (a<b):
        print(f"{a} {b}")
    else:
        print(f"{b} {a}")
    


Fixed submission:
while True:
    a,b=map(int,input().split())
    if (a==b):
        if (a==0):
            break
    if (a<b):
        print(f"{a} {b}")
    else:
        print(f"{b} {a}")
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
c=a//b;
d=a%b
e=(double)a/b
print(f'{c} {d} {e}')



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

print("{0} {1} {2:.8f}".format(a//b,a%b,a/b))

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
c=a//b;
d=a%b
e=(double)a/b
print(f"{c} {d} {e}") 



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

print("{0} {1} {2:.8f}".format(a//b,a%b,a/b))

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
c=a//b
d=a%b
e=(double)a/b
print(f"{c} {d} {e}") 



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

print("{0} {1} {2:.8f}".format(a//b,a%b,a/b))

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

ptint("{0} {1} {2:.8f}",format,(a//b,a%b,a/b))


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

print("{0} {1} {2:.8f}".format(a//b,a%b,a/b))

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

ptint("{0} {1} {2:.8f}".format,(a//b,a%b,a/b))


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

print("{0} {1} {2:.8f}".format(a//b,a%b,a/b))

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

ptint("{0} {1} {2:.8f}".format(a//b,a%b,a/b))


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

print("{0} {1} {2:.8f}".format(a//b,a%b,a/b))
Buggy python submission (verdict: Runtime Error):
a=int(input())
p=3.141592;
print("{0:.6f} {1:.6f}".format(a*a*p,a*2*p))


Fixed submission:
import math
a=float(input())
print("{0:.9f} {1:.9f}".format(a*a*math.pi,a*2*math.pi))

Buggy python submission (verdict: Runtime Error):
a=int(input())
p=3.141592;
print("{0:.9f} {1:.9f}".format(a*a*p,a*2*p))


Fixed submission:
import math
a=float(input())
print("{0:.9f} {1:.9f}".format(a*a*math.pi,a*2*math.pi))

Buggy python submission (verdict: Runtime Error):
a=int(input())
p=3.141592
print("{0:.9f} {1:.9f}".format(a*a*p,a*2*p))


Fixed submission:
import math
a=float(input())
print("{0:.9f} {1:.9f}".format(a*a*math.pi,a*2*math.pi))

Buggy python submission (verdict: Runtime Error):
a=int(input())
p=3.141592
print("{0:.8f} {1:.8f}".format(a*a*p,a*2*p))


Fixed submission:
import math
a=float(input())
print("{0:.9f} {1:.9f}".format(a*a*math.pi,a*2*math.pi))
Buggy python submission (verdict: Runtime Error):
while(True):  
    a=int(input())
    op=char(input())
    b=int(input())
    if(op=='?'):
        break
    elif(op=='+'):
        print(a+b)
    elif(op=='-'):
        print(a-b)
    elif(op=='*'):
        print(a*b)
    elif(op=='/'):
        print(a//b)

        


Fixed submission:
while(True):  
    a,op,b=input().split()
    if(op=='?'):
        break
    elif(op=='+'):
        print(int(a)+int(b))
    elif(op=='-'):
        print(int(a)-int(b))
    elif(op=='*'):
        print(int(a)*int(b))
    elif(op=='/'):
        print(int(a)//int(b))

Buggy python submission (verdict: Runtime Error):
while(True):  
    a,op,b=map(int,input().split())
    if(op=='?'):
        break
    elif(op=='+'):
        print(a+b)
    elif(op=='-'):
        print(a-b)
    elif(op=='*'):
        print(a*b)
    elif(op=='/'):
        print(a//b)

        


Fixed submission:
while(True):  
    a,op,b=input().split()
    if(op=='?'):
        break
    elif(op=='+'):
        print(int(a)+int(b))
    elif(op=='-'):
        print(int(a)-int(b))
    elif(op=='*'):
        print(int(a)*int(b))
    elif(op=='/'):
        print(int(a)//int(b))
Buggy python submission (verdict: Runtime Error):
a=int(input())
max=0
min=10000
sum=0
for i in range(0,a):
    b=int(input())
    if(max<=b):
        max=b
    if(min>=b):
        min=b
    sum+=b;
print("{min} {max} {sum}")
    


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
print(min(a),max(a),sum(a))
Buggy python submission (verdict: Runtime Error):
def CountingSort(A, B, k):
    C = [0] * (k+1)
    #C[i] に i の出現数を記録する 
    for j in range(0,k):
        C[A[j]]+=1
    #print("C ",j,C[:k+1])
    #C[i] に i 以下の数の出現数を記録する
    for i in range(1,k+1):
        C[i] = C[i] + C[i-1]
    #print("C' ",j,C[:k+1])
    for j in range(k-1,-1,-1):
        B[C[A[j]]] = A[j]
        C[A[j]]-=1
        #print(j,A[j],C[A[j]],B[C[A[j]]],B,C)

n = int(input())
A = list(map(int,input().split()))
B = [0] * (n+1)
CountingSort(A,B,n)
print(' '.join(map(str,B[1:])))



Fixed submission:
def CountingSort(A, B, k):
    C = [0] * (k+1)
    for i in range(k):
        C[i] = 0
    #C[i] に i の出現数を記録する 
    for j in range(0,n):
        C[A[j]]+=1
    #print("C ",j,C[:100])
    #C[i] に i 以下の数の出現数を記録する
    for i in range(1,k+1):
        C[i] = C[i] + C[i-1]
    #print("C' ",j,C[:100])
    for j in range(n-1,-1,-1):
        B[C[A[j]]] = A[j]
        C[A[j]]-=1
        #print(j,A[j],C[A[j]],B[C[A[j]]],B,C)

n = int(input())
A = list(map(int,input().split()))
B = [0] * (n+1)
CountingSort(A,B,100000)
print(' '.join(map(str,B[1:])))
Buggy python submission (verdict: Runtime Error):
import math

def prime(n):
    for i in range(2, int(n/2)+1):
        if  n % i == 0:
            return False
    return True

num_prime = []
k = 0
while True:
    n = input()
    if n == '\x04':
        break
    if prime(int(n)):
        if not int(n) in num_prime:
            k += 1
            num_prime.append(int(n))

print(k)

Fixed submission:
import math

def prime(n):
    for i in range(2, int(math.sqrt(n))+1):
        if  n % i == 0:
            return False
    return True

num_prime = []
k = 0
while True:
    try:
        n = input()
    except:
        break
    if prime(int(n)):
        if not int(n) in num_prime:
            k += 1
            num_prime.append(int(n))

print(k)

Buggy python submission (verdict: Time Limit Exceeded):
import math

def prime(n):
    for i in range(2, int(n/2)+1):
        if  n % i == 0:
            return False
    return True

num_prime = []
k = 0
while True:
    try:
        n = input()
    except:
        break
    if prime(int(n)):
        if not int(n) in num_prime:
            k += 1
            num_prime.append(int(n))

print(k)

Fixed submission:
import math

def prime(n):
    for i in range(2, int(math.sqrt(n))+1):
        if  n % i == 0:
            return False
    return True

num_prime = []
k = 0
while True:
    try:
        n = input()
    except:
        break
    if prime(int(n)):
        if not int(n) in num_prime:
            k += 1
            num_prime.append(int(n))

print(k)

Buggy python submission (verdict: Runtime Error):
import math

def prime(n):
    for i in range(2, int(math.sqrt(n))+1:
        if  n % i == 0:
            return False
    return True

num_prime = []
k = 0
while True:
    try:
        n = input()
    except:
        break
    if prime(int(n)):
        if not int(n) in num_prime:
            k += 1
            num_prime.append(int(n))

print(k)

Fixed submission:
import math

def prime(n):
    for i in range(2, int(math.sqrt(n))+1):
        if  n % i == 0:
            return False
    return True

num_prime = []
k = 0
while True:
    try:
        n = input()
    except:
        break
    if prime(int(n)):
        if not int(n) in num_prime:
            k += 1
            num_prime.append(int(n))

print(k)
Buggy python submission (verdict: Runtime Error):
ops ??????{"+": lambda a, b: b + a,
        "-": lambda a, b: b - a,
        "*": lambda a, b: b * a,
        "/": lambda a, b: flaot(b)/a}
stack = []
for s in input().split():
    if s in ops:
        stack.append(ops[s](stack.pop(),stack.pop()))
    else:
        stack.append(int(s))
print stack[-1]

Fixed submission:
ops={"+": lambda a, b: b + a,
        "-": lambda a, b: b - a,
        "*": lambda a, b: b * a,
        "/": lambda a, b: flaot(b)/a}
stack = []
for s in input().split():
    if s in ops:
        stack.append(ops[s](stack.pop(),stack.pop()))
    else:
        stack.append(int(s))
print(stack[-1])
Buggy python submission (verdict: Runtime Error):
n = input()
S = input().split()
q = input()
T = input().split()
cnt = 0

for i in range(T):
    if T[i] in S:
        cnt += 1

print(cnt)

Fixed submission:
n = input()
S = input().split()
q = input()
T = input().split()
cnt = 0

for i in range(len(T)):
    if T[i] in S:
        cnt += 1

print(cnt)
Buggy python submission (verdict: Runtime Error):
n = int(input())
dict = []
for i in range(n):
    order = input().split()
    if order[0] == "insert":
        dict.append(order[1])
    else:
        if order[1] in dict:
            print(Yes)

Fixed submission:
from collections import deque

n = int(input())
dict = {}
for i in range(n):
    order = input().split()
    if order[0] == "insert":
        dict[order[1]] = i
    else:
        if order[1] in dict:
            print("yes")
        else:
            print("no")

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
dict = []
for i in range(n):
    order = input().split()
    if order[0] == "insert":
        dict.append(order[1])
    else:
        if order[1] in dict:
            print("yes")
        else:
            print("no")

Fixed submission:
from collections import deque

n = int(input())
dict = {}
for i in range(n):
    order = input().split()
    if order[0] == "insert":
        dict[order[1]] = i
    else:
        if order[1] in dict:
            print("yes")
        else:
            print("no")

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque

n = int(input())
dict = deque()
for i in range(n):
    order = input().split()
    if order[0] == "insert":
        dict.append(order[1])
    else:
        if order[1] in dict:
            print("yes")
        else:
            print("no")

Fixed submission:
from collections import deque

n = int(input())
dict = {}
for i in range(n):
    order = input().split()
    if order[0] == "insert":
        dict[order[1]] = i
    else:
        if order[1] in dict:
            print("yes")
        else:
            print("no")
Buggy python submission (verdict: Runtime Error):
#S, L, h
import math
a, b, C = map(int, input().split())

S = a*b*math.sin(C*math.pi/180)*(1/2)
L = a+b+math.sqrt(a*a+b*b-2*a*b*math.cos(C*math.pi/180))
h = 2*S/a

print('%.4f %.4f %.4f '% s, L, h)

Fixed submission:
#S, L, h
import math
a, b, C = map(int, input().split())

S = a*b*math.sin(C*math.pi/180)*(1/2)
L = a+b+math.sqrt(a*a+b*b-2*a*b*math.cos(C*math.pi/180))
h = 2*S/a

print('%.4f'% S)
print('%.4f'% L)
print('%.4f'% h)
Buggy python submission (verdict: Runtime Error):
while True:
    a_2 = 0
	n = int(input())
	if n == 0
		break
	
	score = [int(x) for x in input().split()]
	m = some(score)/len(score)

	for i in range(len(score)):
		a += (score[i]-m)*(score[i]-m)/n
	
	print('%.4f', a)

Fixed submission:
import math
while True:
	a_2 = 0
	n = int(input())
	if n == 0:
		break
	
	score = [int(x) for x in input().split()]
	m = sum(score)/len(score)
	#print(m)

	for i in range(len(score)):
		a_2 += (score[i]-m)*(score[i]-m)/n
		#print(a_2)
	print('%.4f'% math.sqrt(a_2))
Buggy python submission (verdict: Runtime Error):
l = map(int, input().split()) #python2?????¨???????????§?????????python?????¨????????????????????§???????????????
i = 1
list = list(l)

while(1):
	if list[i-1] != 0:
		print ("Case "+str(i)+": "+str(list[i-1]))
		i = i+1
	else:
		break

Fixed submission:
i=0
while(1):
	a = int(input())
	if a == 0:
		break
	print ("Case "+str(i+1)+": "+str(a))
	i = i+1

Buggy python submission (verdict: Runtime Error):
l = map(int, input().split()) #python2?????¨???????????§?????????python?????¨????????????????????§???????????????
i = 1
list = list(l)

while(1):
	if list[i-1] != 0:
		print ("Case "+str(i)+": "+str(list[i-1]))
		i = i+1
	else:
		break

Fixed submission:
i=0
while(1):
	a = int(input())
	if a == 0:
		break
	print ("Case "+str(i+1)+": "+str(a))
	i = i+1

Buggy python submission (verdict: Runtime Error):
l = map(int, input().split())
i = 1
list = list(l)

while(1):
	if list[i-1] != 0:
		print ("Case "+str(i)+": "+str(list[i-1]))
		i = i+1
	else:
		break

Fixed submission:
i=0
while(1):
	a = int(input())
	if a == 0:
		break
	print ("Case "+str(i+1)+": "+str(a))
	i = i+1

Buggy python submission (verdict: Runtime Error):
while(1):

	l = map(int, input().split()) #python2?????¨???????????§?????????python?????¨????????????????????§???????????????
	i = 1
	li = list(l)

	while(1):
		if list[i-1] != 0:
			print ("Case "+str(i)+": "+str(list[i-1]))
			i = i+1
		else:
			break

Fixed submission:
i=0
while(1):
	a = int(input())
	if a == 0:
		break
	print ("Case "+str(i+1)+": "+str(a))
	i = i+1
Buggy python submission (verdict: Runtime Error):
while(1):
	a, b = map(int, input().split())
	if a == 0 and b == 0:
		break
	print (str(a)+" "str(b))

Fixed submission:
while(1):
	a, b = map(int, input().split())
	if a == 0 and b == 0:
		break
	if a>b:
		a, b = b, a
	print (str(a)+" "+str(b))

Buggy python submission (verdict: Runtime Error):
while(1):
	a, b = map(int, input().split())
	if a == 0 and b == 0:
		break
	print (str(a)+" "+str(b))

Fixed submission:
while(1):
	a, b = map(int, input().split())
	if a == 0 and b == 0:
		break
	if a>b:
		a, b = b, a
	print (str(a)+" "+str(b))

Buggy python submission (verdict: Runtime Error):
while(1):
	a, b = map(int, input().split())
	if a == 0 and b == 0:
		break
	if a>b:
		a, b = b, a
	print (str(a)+" "+str(b))

Fixed submission:
while(1):
	a, b = map(int, input().split())
	if a == 0 and b == 0:
		break
	if a>b:
		a, b = b, a
	print (str(a)+" "+str(b))
Buggy python submission (verdict: Runtime Error):
import math

r = int(input())

#menseki
a = r*r*math.pi

#ensyu
b = 2*r*math.pi

print("%.5f %.5f" % (a, b))

Fixed submission:
import math

r = float(float(input())) #??´??°??§?????????????????\???????????¨??? int?????????????????????????????????

#menseki
a = r*r*math.pi
 
#ensyu
b = 2*r*math.pi

print("%.6f %.6f" % (a, b))

Buggy python submission (verdict: Runtime Error):
import math

r = int(input())

#menseki
a = r*r*math.pi

#ensyu
b = 2*r*math.pi

print("%.5f %.5f" % (a, b))

Fixed submission:
import math

r = float(float(input())) #??´??°??§?????????????????\???????????¨??? int?????????????????????????????????

#menseki
a = r*r*math.pi
 
#ensyu
b = 2*r*math.pi

print("%.6f %.6f" % (a, b))

Buggy python submission (verdict: Runtime Error):
import math

r = flaot(input())

#menseki
a = r*r*math.pi

#ensyu
b = 2*r*math.pi

print("%.5f %.5f" % (a, b))

Fixed submission:
import math

r = float(float(input())) #??´??°??§?????????????????\???????????¨??? int?????????????????????????????????

#menseki
a = r*r*math.pi
 
#ensyu
b = 2*r*math.pi

print("%.6f %.6f" % (a, b))

Buggy python submission (verdict: Runtime Error):
#small, large or equal

a, b = map(int, input().split())

if a<b:
	print('a < b')
elif a>b:
	print('a > b')
else:
	print('a = b')

Fixed submission:
import math

r = float(float(input())) #??´??°??§?????????????????\???????????¨??? int?????????????????????????????????

#menseki
a = r*r*math.pi
 
#ensyu
b = 2*r*math.pi

print("%.6f %.6f" % (a, b))
Buggy python submission (verdict: Runtime Error):
n = int(input().split("\"))
i = 0
list_n = [n]

for i in range(0, n-1):
	list_n[i] = int(input().split())

min = min(list_n)
max = max(list_n)
sum = sum(list_n)

print("%d %d %d" % (min, max, sum))

Fixed submission:
n = int(input())
i = 0
#list_n = [n]

map_n = map(int, input().split())
list_n = list(map_n)

min = min(list_n)
max = max(list_n)
sum = sum(list_n)

print("%d %d %d" % (min, max, sum))
Buggy python submission (verdict: Runtime Error):
while(1):
	H, W = map(int, input().split())
	if H == 0 and W == 0:
		break
	for i in range(H):
		for j in range(W):
			print("#", end='')
		if j == W-1
			print("")

Fixed submission:
while(1):
	H, W = map(int, input().split())
	if H == 0 and W == 0:
		break
	for i in range(H):
		for j in range(W):
			print("#", end='')
		print("\n", end='')
	print("\n", end='')

Buggy python submission (verdict: Runtime Error):
while(1):
	H, W = map(int, input().split())
	if H == 0 and W == 0:
		break
	for i in range(H):
		for j in range(W):
			print("#", end='')
			if j == W-1 and if i != H-1:
				print("")

Fixed submission:
while(1):
	H, W = map(int, input().split())
	if H == 0 and W == 0:
		break
	for i in range(H):
		for j in range(W):
			print("#", end='')
		print("\n", end='')
	print("\n", end='')

Buggy python submission (verdict: Runtime Error):
while(1):
	H, W = map(int, input().split())
	if H == 0 and W == 0:
		break
	for i in range(H):
		for j in range(W):
			print("#", end='')
			if j == W-1
				print("")

Fixed submission:
while(1):
	H, W = map(int, input().split())
	if H == 0 and W == 0:
		break
	for i in range(H):
		for j in range(W):
			print("#", end='')
		print("\n", end='')
	print("\n", end='')