Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = input().split()
b = a[:]

while flag:
    flag = 0
    for i in range(n-1):
        if a[i][1] > a[i+1][1]:
            a[i][1], a[i+1][1] = a[i+1][1], a[i][1]
            flag = 1
print(*a)
print("Stable")

for i in range(n-1):
    min_j = i
    for j in range(i,n):
        if b[j][1] < b[min_j][1]:
            min_j = j
    b[i][1], b[min_j][1] = b[min_j][1], b[i][1]
print(*b)
if a == b:
    print("Stable")
else:
    print("Not stable")

Fixed submission:
n = int(input())
a = input().split()
b = a[:]
flag = 1
while flag:
    flag = 0
    for i in range(n-1):
        if a[i][1] > a[i+1][1]:
            a[i], a[i+1] = a[i+1], a[i]
            flag = 1
print(*a)
print("Stable")

for i in range(n-1):
    min_j = i
    for j in range(i,n):
        if b[j][1] < b[min_j][1]:
            min_j = j
    b[i], b[min_j] = b[min_j], b[i]
print(*b)
if a == b:
    print("Stable")
else:
    print("Not stable")

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = input().split()
b = a[:]

while flag:
    flag = 0
    for i in range(n-1):
        if a[i][1] > a[i+1][1]:
            a[i][1], a[i+1][1] = a[i+1][1], a[i][1]
            flag = 1
print(*a)
print("Stable")

for i in range(n-1):
    min_j = i
    for j in range(i,n):
        if b[j][1] < b[min_j][1]:
            min_j = j
    b[i][1], b[min_j][1] = b[min_j][1], b[i][1]
print(*b)
if a == b:
    print("Stable")
else:
    print("Not stable")

Fixed submission:
n = int(input())
a = input().split()
b = a[:]
flag = 1
while flag:
    flag = 0
    for i in range(n-1):
        if a[i][1] > a[i+1][1]:
            a[i], a[i+1] = a[i+1], a[i]
            flag = 1
print(*a)
print("Stable")

for i in range(n-1):
    min_j = i
    for j in range(i,n):
        if b[j][1] < b[min_j][1]:
            min_j = j
    b[i], b[min_j] = b[min_j], b[i]
print(*b)
if a == b:
    print("Stable")
else:
    print("Not stable")
Buggy python submission (verdict: Runtime Error):
def insertionSort(a,n,g):
    for i in range(g,n)
        v = a[i]
        j = i - g
        while j >= 0 and a[j] > v
            a[j + g] = a[j]
            j = j - g
            cnt += 1
        a[j + g] = v

n = int(input())
a = [int(input()) for i in range(n)]

cnt = 0
i = 0
g = [1]
while 3*g[i]+1 < n:
    g.append(3*g[i]+1)
    i += 1
m = len(g)

for i in range(m):
    insertionSort(a,n,g)

print(m)
print(*g)
print(cnt)
print(*a, sep="\n")

Fixed submission:
def insertionSort(a,n,g):
    global cnt
    for i in range(g,n):
        v = a[i]
        j = i - g
        while j >= 0 and a[j] > v:
            a[j + g] = a[j]
            j = j - g
            cnt += 1
        a[j + g] = v

cnt = 0
n = int(input())
a = [int(input()) for i in range(n)]

i = 0
g = [1]
while 3*g[i]+1 < n:
    g.append(3*g[i]+1)
    i += 1
g.reverse()
m = len(g)

for i in range(m):
    insertionSort(a,n,g[i])

print(m)
print(*g)
print(cnt)
print(*a, sep="\n")

Buggy python submission (verdict: Runtime Error):
def insertionSort(a,n,g):
    for i in range(g,n):
        v = a[i]
        j = i - g
        while j >= 0 and a[j] > v:
            a[j + g] = a[j]
            j = j - g
            global cnt += 1
        a[j + g] = v

cnt = 0
n = int(input())
a = [int(input()) for i in range(n)]

i = 0
g = [1]
while 3*g[i]+1 < n:
    g.append(3*g[i]+1)
    i += 1
m = len(g)

for i in range(m):
    insertionSort(a,n,g[i])

print(m)
print(*g)
print(cnt)
print(*a, sep="\n")

Fixed submission:
def insertionSort(a,n,g):
    global cnt
    for i in range(g,n):
        v = a[i]
        j = i - g
        while j >= 0 and a[j] > v:
            a[j + g] = a[j]
            j = j - g
            cnt += 1
        a[j + g] = v

cnt = 0
n = int(input())
a = [int(input()) for i in range(n)]

i = 0
g = [1]
while 3*g[i]+1 < n:
    g.append(3*g[i]+1)
    i += 1
g.reverse()
m = len(g)

for i in range(m):
    insertionSort(a,n,g[i])

print(m)
print(*g)
print(cnt)
print(*a, sep="\n")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []
for i in range(n):
    tmp = input().split()
    ope = tmp[0]
    if ope == "insert":
        m = tmp[1]
        l.insert(0,m)
    elif ope == "delete":
        m = tmp[1]
        if m in l:
            l.remove(m)
    elif ope == "deleteFirst":
        l.pop(0)
    elif ope == "deleteLast":
        l.pop()
print(*l)

Fixed submission:
from collections import deque

n = int(input())
d = deque()
for i in range(n):
    tmp = input().split()
    ope = tmp[0]
    if ope == "insert":
        m = tmp[1]
        d.appendleft(m)
    elif ope == "delete":
        m = tmp[1]
        if m in d:
            d.remove(m)
    elif ope == "deleteFirst":
        d.popleft()
    elif ope == "deleteLast":
        d.pop()
print(*d)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []

for i in range(n):
    line = input().split()
    if line[0] == "insert":
        l.append(line[1])
    elif line[0] == "find":
        if line[1] in l:
            print("yes")
        else:
            print("no")

Fixed submission:
n = int(input())
d = {}

for i in range(n):
    line = input().split()
    if line[0] == "insert":
        d[line[1]] = 1
    elif line[0] == "find":
        if line[1] in d:
            print("yes")
        else:
            print("no")

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []

for i in range(n):
    line = input().split()
    if line[0] == "insert":
        l.append(line[1])
    elif line[0] == "find":
        if line[1] in l:
            print("yes")
        else:
            print("no")

Fixed submission:
n = int(input())
d = {}

for i in range(n):
    line = input().split()
    if line[0] == "insert":
        d[line[1]] = 1
    elif line[0] == "find":
        if line[1] in d:
            print("yes")
        else:
            print("no")

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
d = []

for i in range(n):
    line = input().split()
    if line[0] == "insert":
        d.append(line[1])
    elif line[0] == "find":
        if line[1] in d:
            print("yes")
        else:
            print("no")

Fixed submission:
n = int(input())
d = {}

for i in range(n):
    line = input().split()
    if line[0] == "insert":
        d[line[1]] = 1
    elif line[0] == "find":
        if line[1] in d:
            print("yes")
        else:
            print("no")

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
d = []

for i in range(n):
    line = input().split()
    if line[0] == "insert":
        d.append(line[1])
    elif line[0] == "find":
        if line[1] in d:
            print("yes")
        else:
            print("no")

Fixed submission:
n = int(input())
d = {}

for i in range(n):
    line = input().split()
    if line[0] == "insert":
        d[line[1]] = 1
    elif line[0] == "find":
        if line[1] in d:
            print("yes")
        else:
            print("no")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
q = int(input())
m = list(map(int,input().split()))

def solve(i, m_i):
    if m_i == 0:
        return True
    if i >= n:
        return False
    res = solve(i + 1, m_i) or solve(i + 1, m_i - a[i])
    return res

for m_tmp in m:
    if solve(0, m_tmp):
        print("yes")
    else:
        print("no")

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
q = int(input())
m = list(map(int,input().split()))

def solve(i, m_i):
    if m_i == 0:
        return True
    if i >= n:
        return False
    res = solve(i + 1, m_i) or solve(i + 1, m_i - a[i])
    return res

for m_tmp in m:
    if sum(a) < m_tmp:
        print("no")
    elif solve(0, m_tmp):
        print("yes")
    else:
        print("no")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
flag = 1
count = 0
while flag:
    flag = 0
    for i in range(n-1):
        if a[i] > a[i+1]:
            a[i], a[i+1] = a[i+1], a[i]
            count += 1
            flag = 1

print(count)

Fixed submission:
n = int(input())
s = list(map(int,input().split()))
count = 0

def merge(a, left, mid, right):
    global count
    l = a[left:mid] + [float("inf")]
    r = a[mid:right] + [float("inf")]
    i = j = 0
    for k in range(left, right):
        if l[i] <= r[j]:
            a[k] = l[i]
            i += 1
        else:
            a[k] = r[j]
            j += 1
            count += len(l) - i - 1

def mergeSort(a, left, right):
    if left + 1 < right:
        mid = right + (left - right)//2
        mergeSort(a, left, mid)
        mergeSort(a, mid, right)
        merge(a, left, mid, right)

mergeSort(s, 0, n)

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

x = a[-1]
i = -1

for j in range(len(a)-1):
    if a[j] <= x:
        i += 1
        a[i], a[j] = a[j], a[i]

a[i + 1], a[n] = "[" + str(a[n]) + "]", a[i + 1]

print(*a)

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

x = a[-1]
i = -1

for j in range(len(a)-1):
    if a[j] <= x:
        i += 1
        a[i], a[j] = a[j], a[i]

a[i + 1], a[n - 1] = "[" + str(a[n - 1]) + "]", a[i + 1]

print(*a)
Buggy python submission (verdict: Runtime Error):
n = int(input())
tree = [None for i in range(n +1)]
list_pre = list(map(int, input().split()))
list_in = list(map(int, input().split()))
 
 
def reconstruct(tree_pre, tree_in):
    if not tree_pre:
        return -1
    root = tree_pre[0]
    idx = tree_in.index(root)
    tree[root] = (reconstruct(tree_pre[1:i + 1], tree_in[:i]), 
                  reconstruct(tree_pre[i + 1:],  tree_in[i + 1:]))
    return root


def post_order_search(i):
    if i == -1:
        return
    l, r = tree[i]
    for j in post_order_search(l):
        yield j
    for j in post_order_search(r):
        yield j
    yield i


solve(list_pre, list_in)

print(*postorder(list_pre[0]))

Fixed submission:
n = int(input())
tree = [None for i in range(n +1)]
list_pre = list(map(int, input().split()))
list_in = list(map(int, input().split()))
 
 
def solve(tree_pre, tree_in):
    if not tree_pre:
        return -1
    root = tree_pre[0]
    idx = tree_in.index(root)
    tree[root] = (solve(tree_pre[1:idx + 1], tree_in[:idx]), 
                  solve(tree_pre[idx + 1:],  tree_in[idx + 1:]))
    return root


def post_order_search(i):
    if i == -1:
        return
    l, r = tree[i]
    for j in post_order_search(l):
        yield j
    for j in post_order_search(r):
        yield j
    yield i


solve(list_pre, list_in)

print(*post_order_search(list_pre[0]))
Buggy python submission (verdict: Time Limit Exceeded):
a = []
while True:
    inp = input().split()
    if inp[0] == "insert":
        a.append(int(inp[1]))
    elif inp[0] == "extract":
        a.sort()
        print(a.pop())
    else:
        break

Fixed submission:
import heapq

a = []
while True:
    inp = input().split()
    if inp[0] == "insert":
        heapq.heappush(a, -int(inp[1]))
    elif inp[0] == "extract":
        print(-heapq.heappop(a))
    else:
        break

Buggy python submission (verdict: Runtime Error):
a = []
while True:
    inp = input()
    if inp[0] == "i":
        a.append(int(inp[7:]))
    elif inp[0] == "e":
        a.sort()
        print(a.pop())
    else:
        break

Fixed submission:
import heapq

a = []
while True:
    inp = input().split()
    if inp[0] == "insert":
        heapq.heappush(a, -int(inp[1]))
    elif inp[0] == "extract":
        print(-heapq.heappop(a))
    else:
        break

Buggy python submission (verdict: Time Limit Exceeded):
a = []
while True:
    inp = input()
    if inp[0] == "i":
        a.append(int(inp[7:]))
    elif inp == "extract":
        a.sort()
        print(a.pop())
    else:
        break

Fixed submission:
import heapq

a = []
while True:
    inp = input().split()
    if inp[0] == "insert":
        heapq.heappush(a, -int(inp[1]))
    elif inp[0] == "extract":
        print(-heapq.heappop(a))
    else:
        break
Buggy python submission (verdict: Time Limit Exceeded):
n, q = map(int, input().split())

s =[set([i]) for i in range(n)]
p =[i for i in range(n)]

for i in range(q):
    com, x, y = map(int, input().split())
    if com:
        if y in s[p[x]]: print(1)
        else: print(0)
    else:
        s[p[x]] = s[p[x]] | s[p[y]]
        p_x_tmp = p[x]
        p_y_tmp = p[y]
        for j in range(n):
            if p[j] == p_y_tmp: p[j] = p_x_tmp

Fixed submission:
def find(x):
    global s
    if s[x] == x:
        return x
    s[x] = find(s[x])
    return s[x]

n, q = map(int, input().split())

s =[i for i in range(n)]

for i in range(q):
    com, x, y = map(int, input().split())
    if com:
        if find(x) == find(y): print(1)
        else: print(0)
    else:
        s[find(y)] = find(x)
Buggy python submission (verdict: Runtime Error):
class dice:
    def __init__(self, pip):
        self.pip = pip
        
    def move(self,dir):
        if str(dir) == "E":
            self.pip[0],self.pip[2],self.pip[3],self.pip[5] = self.pip[3],self.pip[0],self.pip[5],self.pip[2]
        elif str(dir) == "W":
            self.pip[0],self.pip[2],self.pip[3],self.pip[5] = self.pip[2],self.pip[5],self.pip[0],self.pip[3]
        elif str(dir) == "N":
            self.pip[0],self.pip[1],self.pip[4],self.pip[5] = self.pip[1],self.pip[5],self.pip[0],self.pip[4]
        elif str(dir) == "S":
            self.pip[0],self.pip[1],self.pip[4],self.pip[5] = self.pip[4],self.pip[0],self.pip[5],self.pip[1]

d = dice(list(map(int,input().split())))
n = int(input())

for i in range(n):
    
    top, front = map(int,input().split())
    
    for op in "EEENEEENEEESEEESEEENEEEN"
        d.move(op)
        if d.pip[0] == top and d.pip[1] == front:
            break
    
    print(d.pip[2])

Fixed submission:
class dice:
    def __init__(self, pip):
        self.pip = pip
        
    def move(self,dir):
        if str(dir) == "E":
            self.pip[0],self.pip[2],self.pip[3],self.pip[5] = self.pip[3],self.pip[0],self.pip[5],self.pip[2]
        elif str(dir) == "W":
            self.pip[0],self.pip[2],self.pip[3],self.pip[5] = self.pip[2],self.pip[5],self.pip[0],self.pip[3]
        elif str(dir) == "N":
            self.pip[0],self.pip[1],self.pip[4],self.pip[5] = self.pip[1],self.pip[5],self.pip[0],self.pip[4]
        elif str(dir) == "S":
            self.pip[0],self.pip[1],self.pip[4],self.pip[5] = self.pip[4],self.pip[0],self.pip[5],self.pip[1]

d = dice(list(map(int,input().split())))
n = int(input())

for i in range(n):
    
    top, front = map(int,input().split())
    
    for op in "EEENEEENEEESEEESEEENEEEN":
        if d.pip[0] == top and d.pip[1] == front:
            break
        d.move(op)    
    print(d.pip[2])
Buggy python submission (verdict: Runtime Error):
l = input().split()
print(int(l[0])*int(l[1]),2*int(l[0])+2*int(l[1])

Fixed submission:
inp=input().split()
ab=[int(inp[0]),int(inp[1])]
print(ab[0]*ab[1],ab[0]*2+ab[1]*2)

Buggy python submission (verdict: Runtime Error):
ab=input()
print(ab[0]*ab[1],ab[0]*2+ab[1]*2)

Fixed submission:
inp=input().split()
ab=[int(inp[0]),int(inp[1])]
print(ab[0]*ab[1],ab[0]*2+ab[1]*2)
Buggy python submission (verdict: Runtime Error):
inp=input()
a = int(inp[0])
b = int(inp[1])
if a < b:
    print("a < b")
elif a > b:
    print("a > b")
else:
    print("a == b")

Fixed submission:
inp=input().split()
a = int(inp[0])
b = int(inp[1])
if a < b:
    print("a < b")
elif a > b:
    print("a > b")
else:
    print("a == b")
Buggy python submission (verdict: Runtime Error):
a,b,c = int(input())
if a < b and b < c:
    print("Yes")
else:
    print("No")

Fixed submission:
inp=input().split()
if inp[0] < inp[1] and inp[1] < inp[2]:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
l = int(input())
if l[0] < l[1] and l[1] < l[2]:
    print("Yes")
else:
    print("No")

Fixed submission:
inp=input().split()
if inp[0] < inp[1] and inp[1] < inp[2]:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
l = input()
if int(l[0]) < int(l[1]) and int(l[1]) < int(l[2]):
    print("Yes")
else:
    print("No")

Fixed submission:
inp=input().split()
if inp[0] < inp[1] and inp[1] < inp[2]:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
l = input()
if int(l[0]) < int(l[1]) and int(l[1]) < int(l[2]):
    print("Yes")
else:
    print("No")

Fixed submission:
inp=input().split()
if inp[0] < inp[1] and inp[1] < inp[2]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
inp = input().split()
l = list(map(int,inp)).sort
print(l[0],l[1],l[2])

Fixed submission:
inp = list(map(int,input().split()))
inp.sort()
print(inp[0],inp[1],inp[2])

Buggy python submission (verdict: Runtime Error):
inp = input().split()
l = list(map(int,inp)).sort()
print(l[0],l[1],l[2])

Fixed submission:
inp = list(map(int,input().split()))
inp.sort()
print(inp[0],inp[1],inp[2])

Buggy python submission (verdict: Runtime Error):
inp = input().split()
l = list(map(int,inp))
l = l.sort()
print(l[0],l[1],l[2])

Fixed submission:
inp = list(map(int,input().split()))
inp.sort()
print(inp[0],inp[1],inp[2])

Buggy python submission (verdict: Runtime Error):
inp = list(map(int,input().split()))
l = inp.sort()
print(l[0],l[1],l[2])

Fixed submission:
inp = list(map(int,input().split()))
inp.sort()
print(inp[0],inp[1],inp[2])

Buggy python submission (verdict: Runtime Error):
inp = list(map(int,input().split()))
l = inp.sort()
print(l[0],l[1],l[2])

Fixed submission:
inp = list(map(int,input().split()))
inp.sort()
print(inp[0],inp[1],inp[2])

Buggy python submission (verdict: Runtime Error):
inp = list(map(int,input().split()))
l = inp.sort()
print(l[0],l[1],l[2])

Fixed submission:
inp = list(map(int,input().split()))
inp.sort()
print(inp[0],inp[1],inp[2])

Buggy python submission (verdict: Runtime Error):
inp =list(map(int,input().split()))
l=inp.sort()
print(l[0],l[1],l[2])

Fixed submission:
inp = list(map(int,input().split()))
inp.sort()
print(inp[0],inp[1],inp[2])

Buggy python submission (verdict: Runtime Error):
inp =list(map(int,input().split()))
l=inp.sort()
print(l[0],l[1],l[2])

Fixed submission:
inp = list(map(int,input().split()))
inp.sort()
print(inp[0],inp[1],inp[2])
Buggy python submission (verdict: Runtime Error):
i = 1
while True:
    n = input()
    if n == 0:
        break
    print("Case ",i,": ",n,sep="")

Fixed submission:
i = 1
while True:
    n = int(input())
    if n == 0:
        break
    print("Case ",i,": ",n,sep="")
    i += 1
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split()))
print("%d %d %.5f\n" %(a//b,a%b,a/b))

Fixed submission:
a,b = map(int,input().split())
print("%d %d %.5f\n" % (a//b,a%b,a/b))

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split()))
print("%d %d %.5f\n"%(a//b,a%b,a/b))

Fixed submission:
a,b = map(int,input().split())
print("%d %d %.5f\n" % (a//b,a%b,a/b))

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split()))
print('%d %d %.5f\n'%(a//b,a%b,a/b))

Fixed submission:
a,b = map(int,input().split())
print("%d %d %.5f\n" % (a//b,a%b,a/b))
Buggy python submission (verdict: Runtime Error):
while True:
    h,w = map(int,input().split())
    if h == 0 and w == 0:
        break
    for i in range(h)
        print("#" * w)
    print()

Fixed submission:
while True:
    h,w = map(int,input().split())
    if h == 0 and w == 0:
        break
    for i in range(h):
        print("#"*w)
    print("")

Buggy python submission (verdict: Runtime Error):
while True:
    h,w = map(int,input().split())
    if h == 0 and w == 0:
        break
    for i in range(h)
        print("#" * w)
    print("")

Fixed submission:
while True:
    h,w = map(int,input().split())
    if h == 0 and w == 0:
        break
    for i in range(h):
        print("#"*w)
    print("")

Buggy python submission (verdict: Runtime Error):
while True:
    h,w = map(int,input().split())
    if h == 0 and w == 0:
        break
    for i in range(h)
        print("#"*w)
    print()

Fixed submission:
while True:
    h,w = map(int,input().split())
    if h == 0 and w == 0:
        break
    for i in range(h):
        print("#"*w)
    print("")

Buggy python submission (verdict: Runtime Error):
while True:
    h,w = map(int,input().split())
    if h == 0 and w == 0:
        break
    for i in range(h)
        print("#")
    print()

Fixed submission:
while True:
    h,w = map(int,input().split())
    if h == 0 and w == 0:
        break
    for i in range(h):
        print("#"*w)
    print("")

Buggy python submission (verdict: Runtime Error):
while True:
    h,w = map(int,input().split())
    if h == 0 and w == 0:
        break
    for i in range(h)
        print("#" * w)

Fixed submission:
while True:
    h,w = map(int,input().split())
    if h == 0 and w == 0:
        break
    for i in range(h):
        print("#"*w)
    print("")

Buggy python submission (verdict: Runtime Error):
while True:
    h,w = map(int,input().split())

Fixed submission:
while True:
    h,w = map(int,input().split())
    if h == 0 and w == 0:
        break
    for i in range(h):
        print("#"*w)
    print("")
Buggy python submission (verdict: Runtime Error):
while True:
    h,w = map(int,input().split())
    if h == 0 and w == 0:
        break
    sym1 = "#"
    sym2 = "."
    for i in range(h):
        if i%2 = 1:
		    sym1 = "#"
		    sym2 = "."
        else:
		    sym1 = "."
		    sym2 = "#"

        for j in range(w):
	        if j%2 == 1:
	            print(sym1,end="")
	        else:
	            print(sym2,end="")
	    print("")
    
    print("")

Fixed submission:
while True:
    h,w = map(int,input().split())
    if h == 0 and w == 0:
        break
    for i in range(h):
        if i%2 == 1:
            sym1 = "#"
            sym2 = "."
        else:
            sym1 = "."
            sym2 = "#"

        for j in range(w):
            if j%2 == 1:
                print(sym1,end="")
            else:
                print(sym2,end="")
        print("")
    
    print("")

Buggy python submission (verdict: Runtime Error):
while True:
    h,w = map(int,input().split())
    if h == 0 and w == 0:
        break
    for i in range(h):
        if i%2 = 1:
            sym1 = "#"
            sym2 = "."
        else:
            sym1 = "."
            sym2 = "#"

        for j in range(w):
            if j%2 == 1:
                print(sym1,end="")
            else:
                print(sym2,end="")
        print("")
    
    print("")

Fixed submission:
while True:
    h,w = map(int,input().split())
    if h == 0 and w == 0:
        break
    for i in range(h):
        if i%2 == 1:
            sym1 = "#"
            sym2 = "."
        else:
            sym1 = "."
            sym2 = "#"

        for j in range(w):
            if j%2 == 1:
                print(sym1,end="")
            else:
                print(sym2,end="")
        print("")
    
    print("")
Buggy python submission (verdict: Runtime Error):
n = int(input())
inp = map(int,input().split())
inp.reverse()
for i in range(n-1):
	print(inp[i]," ",sep="",end="")
print(inp[n-1])

Fixed submission:
n = int(input())
inp = list(map(int,input().split()))
inp.reverse()
for i in range(n-1):
	print(inp[i]," ",sep="",end="")
print(inp[n-1])

Buggy python submission (verdict: Runtime Error):
n = int(input())
inp = map(int,input().split())
inp.reverse()
print(inp[n-1])

Fixed submission:
n = int(input())
inp = list(map(int,input().split()))
inp.reverse()
for i in range(n-1):
	print(inp[i]," ",sep="",end="")
print(inp[n-1])

Buggy python submission (verdict: Runtime Error):
n = int(input())
inp = map(int,input().split())
inp.reverse()
for i in range(n-1):
	print(inp[i]," ",sep="",end="")

Fixed submission:
n = int(input())
inp = list(map(int,input().split()))
inp.reverse()
for i in range(n-1):
	print(inp[i]," ",sep="",end="")
print(inp[n-1])