qyliang/CodeNanoFix huggingface dataset:
Buggy code:
while True:
  (H, W) = [int(i) for i in input().split()]
  if H == W == 0;
    break

  for hc in range(H):
    for wc in range(W):
      if (hc + wc) % 2 == 0:
        print('#', end='')
      else:
        print('.', end='')
    print()
  print()

Fixed code:
while True:
  (H, W) = [int(i) for i in input().split()]
  if H == W == 0:
    break

  for hc in range(H):
    for wc in range(W):
      if (hc + wc) % 2 == 0:
        print('#', end='')
      else:
        print('.', end='')
    print()
  print()
Buggy code:
def chess(h,w):
  if (h+w) % 2 == 0:
    return '#'
  return '.'

while True:
  H, W = map(int, input().split())
  if H == 0 and W == 0:
    break
  for i in range(H):
    for j in range(W):
      print(chess(I,j), end='')
    print()
  print()



Fixed code:
def chess(h,w):
  if (h+w) % 2 == 0:
    return '#'
  return '.'

while True:
  H, W = map(int, input().split())
  if H == 0 and W == 0:
    break
  for i in range(H):
    for j in range(W):
      print(chess(i,j), end='')
    print()
  print()
Buggy code:
while True:
    
    H, W = [int(i) for i in input().split()]
    if H == W == 0:
        break    
    for a in range(H):
        for b in range(W):
             if a % 2 == 0 or b % 2 == 0:
                  print('#', end='')
             else:
                  print('.', end='')
        print()
    print()
         

Fixed code:
while True:
    
    H, W = [int(i) for i in input().split()]
    if H == W == 0:
        break    
    for a in range(H):
        for b in range(W):
             if (a + b) % 2 == 0:
                  print('#', end='')
             else:
                  print('.', end='')
        print()
    print()
Buggy code:
while True:
    num = list(map(int,input().split()))
    if(num[0] == 0 and num[0] == 0): break
    else:
        flag = False
        for i in range(num[0]):
            str = ""
            if(i % 2 == 0):flag = True
            else: flag = False
            for j in range(num[0]):
                if(flag):
                    str = str + "#" 
                    flag = False
                else:
                    str = str + "."
                    flag = True
            print(str)
        print("")


Fixed code:
while True:
    num = list(map(int,input().split()))
    if(num[0] == 0 and num[0] == 0): break
    else:
        flag = False
        for i in range(num[0]):
            str = ""
            if(i % 2 == 0):flag = True
            else: flag = False
            for j in range(num[1]):
                if(flag):
                    str = str + "#" 
                    flag = False
                else:
                    str = str + "."
                    flag = True
            print(str)
        print("")
Buggy code:
while True:
    h,w = map(int,input().split())
    if h == w == 0:
        break;
    first="#."
    for i in range(h):
        print(first*(w//2)+first*(w%2))
        first=first[1]+first[0]

    print()

Fixed code:
while True:
    h,w = map(int,input().split())
    if h == w == 0:
        break;
    first="#."
    for i in range(h):
        print(first*(w//2)+first[0]*(w%2))
        first=first[1]+first[0]

    print()
Buggy code:
# Print a Chessboard

end = 0
while end == 0:
    rectangle = [int(i) for i in input().rstrip().split()]
    height = rectangle[0]
    width = rectangle[1]
    if [height, width] == [0, 0]:
        end += 1
    else:
        for i in range(height):
            for j in range(width):
                sum = i + j
                if sum % 2 == 0:
                    print('#', end = "")
                elif sum % 2 == 1:
                    print('.', end = "")
            print()



Fixed code:
# Print a Chessboard

end = 0
while end == 0:
    rectangle = [int(i) for i in input().rstrip().split()]
    height = rectangle[0]
    width = rectangle[1]
    if [height, width] == [0, 0]:
        end += 1
    else:
        for i in range(height):
            for j in range(width):
                sum = i + j
                if sum % 2 == 0:
                    print('#', end = "")
                elif sum % 2 == 1:
                    print('.', end = "")
            print()
        print()
Buggy code:
h, w = map(int, input().split())

while h != 0:
    s1 = "#"
    s2 = "."
    for i in range(h):
        if i % 2 == 0:
            for j in range(w):
                if j % 2 == 0:
                    print(s1, end="")
                else:
                    print(s2, end = "")
            print()
                    
        else:
            for j in range(w):
                if j % 2 == 0:
                    print(s2, end="")
                else:
                    print(s1, end = "")
            print()
        
        
    h, w = map(int, input().split())


Fixed code:

h, w = map(int, input().split())

while h != 0:
    s1 = "#"
    s2 = "."
    for i in range(h):
        if i % 2 == 0:
            for j in range(w):
                if j % 2 == 0:
                    print(s1, end="")
                else:
                    print(s2, end = "")
            print()
                    
        else:
            for j in range(w):
                if j % 2 == 0:
                    print(s2, end="")
                else:
                    print(s1, end = "")
            print()
        
    print()    
    h, w = map(int, input().split())
Buggy code:
while True:
    x=input().split()
    W, H = int(x[0]), int(x[1])
    if W==0 and H==0:
        break
    hantei=True
    for i in range(W):
        if hantei:
            if H%2 == 0:
                print("#."*(H//2))
            elif H%2 == 1:
                print("#."*(H//2)+"#")
            hantei=False
        else:
            if H%2 == 0:
                print(".#"*(H//2))
            elif H%2 == 1:
                print(".#"*(H//2)+".")
            hantei = True

Fixed code:
while True:
    x=input().split()
    W, H = int(x[0]), int(x[1])
    if W==0 and H==0:
        break
    hantei=True
    for i in range(W):
        if hantei:
            if H%2 == 0:
                print("#."*(H//2))
            elif H%2 == 1:
                print("#."*(H//2)+"#")
            hantei=False
        else:
            if H%2 == 0:
                print(".#"*(H//2))
            elif H%2 == 1:
                print(".#"*(H//2)+".")
            hantei = True
    print("")
Buggy code:
count = 0
while 1:
    if(count != 0):
        print()
    count += 1
    H, W = map(int, input().split())
    if(H == 0 and W == 0):
        break
    for i in range(H):
        if(i != 0):
            print()
        for j in range(W):
            if(i%2 == 0):
                if(j%2 == 0):
                    print('#',end="")
                else:
                    print('.',end="")
            else:
                if(j%2 == 0):
                    print('.',end="")
                else:
                    print('#',end="")



Fixed code:
while True:
    H,W=map(int,input().split())
    
    if H==0 and W==0:
        break
    
    else:
        for i in range(1,H+1):
            for j in range(1,W+1):
                if i%2==1 :
                    if j%2==1 :
                        print("#",end="")
                    else:
                        print(".",end="")
                else:
                    if j%2==1 :
                        print(".",end="")
                    else:
                        print("#",end="")
            print()
        print()
Buggy code:
while True:
    h,w = map(int,input().split())
    if h == 0 and w == 0:
        break
    for i in range(h):
        if 0 == (i % 2):
            out = ""
            for j in range(w):
                if 0 == (j % 2):
                    out += "#"
                else:
                    out += "."
            print(out)
        else:
            out = ""
            for j in range(w):
                if 0 == (j % 2):
                    out += "."
                else:
                    out += "#"
            print(out)


Fixed code:
while True:
    h,w = map(int,input().split())
    if h==0 and w==0:
        break
    else:
        for i in range(h):
            for j in range(w):
                if int(i+j)%2==0:
                    print("#",end="")
                else:
                    print(".",end="")
            print()
        print()
Buggy code:
while True:
  h, w = [int(n) for n in input().split()]

  if h == 0 and w == 0:
    quit()

  for i in range(0, h):
    for j in range(0, w):
      if i%2 == 0 and j%2 == 1 or i%2 == 1 and j%2 == 0:
        print("#", end='')
      else:
        print(".", end='')
    print()
  print()

Fixed code:
while True:
  h, w = [int(n) for n in input().split()]

  if h == 0 and w == 0:
    quit()

  for i in range(0, h):
    for j in range(0, w):
      if i%2 == 0 and j%2 == 1 or i%2 == 1 and j%2 == 0:
        print(".", end='')
      else:
        print("#", end='')
    print()
  print()
Buggy code:
while True:
    H, W = [int(i) for i in input().split()]
    if H ==0 and W ==0:
        break
    for i in range(2, H+2):
        if i%2 ==0:
            for k in range(1,W+1):
                if k%2 ==0:
                    print('.',end='')
                else:
                    print('#',end='')
            print()
        else:
            for h in range(1,W+1):
                if h%2 ==0:
                    print('#',end='')
                else:
                    print('.',end='')
            print()

Fixed code:
while True:
    H, W = [int(i) for i in input().split()]
    if H ==0 and W ==0:
        break
    for i in range(2, H+2):
        if i%2 ==0:
            for k in range(1,W+1):
                if k%2 ==0:
                    print('.',end='')
                else:
                    print('#',end='')
            print()
        else:
            for h in range(1,W+1):
                if h%2 ==0:
                    print('#',end='')
                else:
                    print('.',end='')
            print()
    print()
Buggy code:
import sys
write=sys.stdout.write

h_numbers=[]
w_numbers=[]

while True:
    numbers=[]
    numbers=input().split()
    numbers[0]=int(numbers[0])
    numbers[1]=int(numbers[1])
    if numbers[0]==0 and numbers[1]==0:
        break
    h_numbers.append(numbers[0])
    w_numbers.append(numbers[1])

for i in range(0,len(h_numbers)):
    for j in range(0,h_numbers[i]):
        for k in range(0,w_numbers[i]):
            if (j+k+2)%2==0:
                write('#')
            else:
                write('.')
        print()

Fixed code:
import sys
write=sys.stdout.write

h_numbers=[]
w_numbers=[]

while True:
    numbers=[]
    numbers=input().split()
    numbers[0]=int(numbers[0])
    numbers[1]=int(numbers[1])
    if numbers[0]==0 and numbers[1]==0:
        break
    h_numbers.append(numbers[0])
    w_numbers.append(numbers[1])

for i in range(0,len(h_numbers)):
    for j in range(0,h_numbers[i]):
        for k in range(0,w_numbers[i]):
            if (j+k+2)%2==0:
                write('#')
            else:
                write('.')
        print()
    print()
Buggy code:
while True:
    h, w = map(int, raw_input().split())
    if h == 0 and w == 0:
        break
    else:
        for i in range(h):
            s = ''
            for j in range(w):
                if (i + j) % 2 == 0:
                    s += '#'
                else:
                    s += '.'
            print s

Fixed code:
while True:
    h,w = map(int,input().split())
    if h==0 and w==0: break

    for i in range(h):
        s = ''
        for j in range(w):
            if (i+j)%2==0: s += '#'
            else: s+='.'
        print(s)
    print()
Buggy code:
while True:
    h,w = map(int,input().split())
    if h==0 and w==0: break

    for i in range(h):
        for j in range(w):
            if (i+j)%2==0: print('#',end=='')
            else: print('.',end=='')
            if j==w-1: print()
    print()
    



Fixed code:
while True:
    h, w = map(int, input().split())
    if(w == h == 0): break
    for i in range(h):
        for j in range(w):
            if (i + j) % 2:
                print('.', end = '')
            else:
                print('#', end = '')
        print('')
    print('')
Buggy code:
while True:
    H, W = map(int, input().split())
    if H == 0 and W == 0: break
    
    for i in range(0,H) :
        for j in range(0,W):
            if((i+j)%2 == 0):
                print('#',end="")
            else:
                print('.',end="")
    print()


Fixed code:
while True:
    H, W = [int(i) for i in input().split()]
    if H == 0 and W == 0:
        break

    for i in range(H):
        for j in range(W):
            if (i + j) % 2 == 0:
                print('#', end='')
            else:
                print('.', end='')
        print('')
    print('')
Buggy code:
while True:
    H, W = map(int, input().split())
    if H == 0 and W == 0: break
    h = int(H/2)
    for i in range(0,H) :
        if(W%2 ==0):
            print('#.'*h)
        else:
            print('#' + '.#'*h)
        
        
    print()


Fixed code:
while True:
    H,W=map(int,input().split())
    if H==W==0:
        break
    for i in range(H):
        if i % 2 == 0:
            print('#.' * (W // 2) + '#' * (W % 2))
        else:
            print('.#' * (W // 2) + '.' * (W % 2))
    print()
Buggy code:
while True:
    W = input()
    H = input()
    if H == 0 and W == 0: break

    for i in range(0,H) :
        for j in range(0,W):
            if(i+j)%2 == 0:
                print("#", end='')
            else:
                print(".", end='')
        print("")
     print("") 


Fixed code:
while True :
    H,W = map(int,input().split())
    if (H == 0 and W == 0) : break
    for j in range(H) :
        for i in range(W) : 
            if (i + j) % 2 == 0 :
                print("#", end = "")
            else :
                print(".", end = "")
        print()
    print()
Buggy code:
while True:
    H, W = map(int, input().split())
    if H == 0 and W == 0: break

    for i in range(0,H) :
        for j in range(0,W):
            if(i+j)%2 == 0:
                print('#')
            else:
                print('.')
        print()
    print()


Fixed code:
def main():
    while True:
        H, W = map(int, input().split())
        if H == 0 and W == 0:
            break
        for i in range(H):
            col = ''
            for j in range(W):
                if i % 2 == 0:
                    if j % 2 == 0:
                        col += '#'
                    else:
                        col += '.'
                else:
                    if j % 2 == 0:
                        col += '.'
                    else:
                        col += '#'
            print(col)
        print()


main()
Buggy code:
while True:
    H,W = map(int,input().split())

    if H == W == 0:
        break
    for i in range(H):
        if i % 2 == 0:
            print("#"+".")
        else:
            print("."+"#")
    print("")
            
            
            


Fixed code:
while True:
    H, W = map(int, input().split())
    if H ==0 and W == 0:
        break
    for i in range(H):
        a = ""
        for j in range(W):
            if (i % 2) == 0:
                if (j % 2) == 0:
                    a += "#"
                else:
                    a += "."
            else:
                if (j % 2) == 0:
                    a += "."
                else:
                    a += "#"
            
        print(a)
    print("")
Buggy code:
while True:
  h,w=map(int,input().split())
  if h==0 & w==0:
    break
  for i in range(h):
    print("#."*w[i%2:][:w])
  print()   


Fixed code:
while True:
  h,w=map(int,input().split())
  if h==0 & w==0:
    break
  for i in range(h):
    print(("#."* w)[i%2:][:w])
  print()
Buggy code:
while True:
    H,W = map(int,input().split())
    
    if H == W == 0:
        break
    for i in range(H):
        if i % 2 == 0:
            print("#."*(W/2),sep="")
        else:
            print(".#"*(W/2),sep="")
    print("")


Fixed code:
while True:
    H,W=map(int,input().split())
    if H==0 and W==0:
        break
    for i in range(H):
        if i%2==0:
            if W%2==0:
                print(('#'+'.')*(W//2))
            else:
                print(('#'+'.')*(W//2)+'#')
        else:
            if W%2==0:
                print(('.'+'#')*(W//2))
            else:
                print(('.'+'#')*(W//2)+'.')
    print('')
Buggy code:
while True:
  h,w=map(int,input().split())
  if h==0 & w==0:
    break
  for i in range(h):
    for i in range(w):
      if (i+j)%2==0:
        print("#", end ="")
      else:
        print(".", end="")
    print("")
  print("")


Fixed code:
while True:
    h,w = map(int,input().split())
    if h == 0 and h ==0:
        break
    for j in range(h):
        for i in range(w):
            if j%2 == 0:
                if i%2 == 0:
                    print('#',end='')
                else:
                    print('.',end='')
            else:
                if i%2 == 0 :                        
                    print('.',end='')
                else:
                    print('#',end='')
        print()
    print()
Buggy code:
while True:
    H,W = map(int,input().split())

    if H == W == 0:
        break
    
    for i in range(H):
        if i % 2 == 0:
            print("#",".",end='')
        else:
            print(".","#",end='')
    print("")
            
            
            


Fixed code:
while True :
    H, W = map(int, input().split())
    if H == 0 and W == 0 :
        break
    
    for j in range(H) :
        for i in range(W) :
            if (j + i) % 2 == 0 :
                print("#", end = "")
            else :
                print(".", end = "")
        print()
    print()
Buggy code:
while True:
    H,W = map(int,input().split())
    
    if H == W == 0:
        break
    for i in range(H):
        print(('#.'*w)[i%2:][:w])
    print()



Fixed code:
while True:
    H,W = map(int,input().split())
    if H == W == 0:
        break
    for i in range(H):
        print(('#.'*W)[i%2:][:W])
    print()
Buggy code:
while True:
    H, W = [int(i) for i in input().split()]
    if H == W == 0:
       break

    for h in range(H):
        for w in range(W):
            if (h + w) % 2 == 0:
                print('#', end='')
            else:
                print('.', end='')

        print()


        

Fixed code:
while True:
    H, W = [int(i) for i in input().split()]
    if H == W == 0:
       break

    for h in range(H):
        for w in range(W):
            if (h + w) % 2 == 0:
                print('#', end='')
            else:
                print('.', end='')

        print()
    print()
Buggy code:
while True:
    h,w = map(int, input().split())
    if (h,w == 0):
        break
    for i in range(h):
        if (i % 2 == 0):
            print("#."*(w//2) + "#"*(w%2))
        elif (i % 2 == 1):
            print(".#"*(w//2) + "."*(w%2))
    print()


Fixed code:
while True:
    h,w = map(int, input().split())
    if (h == 0 and w == 0):
        break
    for i in range(h):
        if (i % 2 == 0):
            print("#."*(w//2) + "#"*(w%2))
        elif (i % 2 == 1):
            print(".#"*(w//2) + "."*(w%2))
    print()
Buggy code:
while True:
    (H, W) = [int(x) for x in input().split()]
    if H == W == 0:
        break
 
    for hc in range(H):
        for wc in range(W):
            if (hc + wc)  % 2 == 0:
                print('#', end='') 
            else:
                print('#', end='')
        print()
    print()

Fixed code:
while True:
    (H, W) = [int(x) for x in input().split()]
    if H == W == 0:
        break
  
    for hc in range(H):
        for wc in range(W):
            if (hc + wc)  % 2 == 0:
                print('#', end='') 
            else:
                print('.', end='')
        print()
    print()
Buggy code:
while True:
    h, w = input().split()
    if h == "0" and w == "0":
        break
    s = "."
    for j in range(int(h)):
        for i in range(int(w)):
            if s == ".":
                s = "#"
            else:
                s = "."
            print(s, end="")
        print()
    print()

Fixed code:
while True:
    h, w = input().split()
    if h == "0" and w == "0":
        break
    for j in range(int(h)):
        for i in range(int(w)):
            if (i+j) % 2 == 0:
                s = "#"
            else:
                s = "."
            print(s, end="")
        print()
    print()
Buggy code:
while True:
	W, H = map(int, input().split())
	if H == W == 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 code:
while True:
    H,W = map(int,input().split())
    if H == 0 and W == 0: break
    for i in range(H):
        for j in range(W):
            if ((i+1) % 2 == 1 and (j+1) % 2 == 1) or ((i+1) % 2 == 0 and (j+1) % 2 == 0):
                print("#",end="")
            else:
                print(".",end="")
        print()
    print("")
Buggy code:
while True:
    H, W = [int(x) for x in input().split()]
    if H == W == 0:
        break
    for i in range(H):
        print(''.join(['#' if i & j & 1 == 0 else '.' for j in range(W)]))
    print()

Fixed code:
while True:
    H, W = [int(x) for x in input().split()]
    if H == W == 0:
        break
    for i in range(H):
        print(''.join(['#' if i + j & 1 == 0 else '.' for j in range(W)]))
    print()
Buggy code:
n = int(input())

for i in range(3, n + 1):
    if i % 3 == 0:
        print(i)
    elif '3' in list(str(i)):
        print(i)

Fixed code:
n = int(input())
for i in range(1, n+1):
    if i % 3 == 0:
        print(' ' + str(i), end='')
    elif '3' in str(i):
        print(' ' + str(i), end='')
print('')
Buggy code:
n=int(input())
for i in range(1,n):
    if i%3==0:
        print(" ",end="")
        print(i,end="")
    elif str(i).find("3")>-1:
        print(" ",end="")
        print(i,end="")
print()



Fixed code:
n=int(input())
for i in range(1,n+1):
    if i%3==0:
        print(" ",end="")
        print(i,end="")
    elif str(i).find("3")>-1:
        print(" ",end="")
        print(i,end="")
print()
Buggy code:
for i in range(3, int(input() + 1):
    if i % 3 == 0 or '3' in str(i):
        print('', i, end='')
print()

Fixed code:
n = int(input())
for i in range(3,n+1):
    if i%3 == 0 or '3' in str(i):
        print('', i, end='')
print ()
Buggy code:
def call(n):
    ans = []

    for x in range(n + 1):
        if x % 3 == 0:
            ans.append(x)
            continue

        while x % 10 == 3:
            ans.append(x)
            x //= 10

    print(" ".join(map(str, ans)))


if __name__ == '__main__':
    from sys import stdin

    n = int(stdin.readline().rstrip())

    print(call(n))



Fixed code:
def call(n):
    ans = []

    for i, x in enumerate(range(1, n + 1), 1):
        if x % 3 == 0:
            ans.append(i)
            continue

        while x:
            if x % 10 == 3:
                ans.append(i)
                break
            x //= 10

    print(" " + " ".join(map(str, ans)))


if __name__ == '__main__':
    from sys import stdin

    n = int(stdin.readline().rstrip())

    call(n)
Buggy code:
n = int(input())
y = 1

while y <= n+1 :
    if(y % 3 == 0):
        print(' %d'%y,end='')
    else:
        p = y
        while(p != 0):
            if(p % 10 == 3):
                print(' %d'%y,end='')
            
            p //= 10
    y+=1
print()



Fixed code:
n = int(input())
y = 1

while y <= n :
    if(y % 3 == 0):
        print(' %d'%y,end='')
    else:
        p = y
        while(p != 0):
            if(p % 10 == 3):
                print(' %d'%y,end='')
                break
            p //= 10
    y+=1
print()