Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import math


def solve(e):
    k = []
    for z in range(99, -1, -1):
        z3 = z * z * z
        if z3 > e:
            continue
        e2 = e - z3

        ylm = int(math.sqrt(e2))
        xzlm = 3 * z * z + 3 * z + 1

        for y in range(ylm, -1, -1):
            y2 = y * y
            if y2 > e2:
                continue
            e3 = e2 - y2

            xylm = 2 * y + 1
            x = e3
            if x > xylm or x > xzlm:
                continue
            k.append(z + y + x)
    return sorted(k)[0]


def main():
    while True:
        a = int(input())

        if a == 0:
            break

        print(solve(a))


if __name__ == '__main__':
    main()



Fixed submission:
import math


def solve(e):
    k = 2 ** 32
    for z in range(100, -1, -1):
        z3 = z * z * z
        if z3 > e:
            continue
        e2 = e - z3

        ylm = int(math.sqrt(e2))

        for y in range(ylm, -1, -1):
            y2 = y * y
            if e2 > (y + 1) * (y + 1):
                break
            e3 = e2 - y2

            x = e3
            k = min(k, x + y + z)
    return k


def main():
    while True:
        a = int(input())

        if a == 0:
            break

        print(solve(a))


if __name__ == '__main__':
    main()

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


def solve(e):
    k = 2 ** 32
    for z in range(99, -1, -1):
        z3 = z * z * z
        if z3 > e:
            continue
        e2 = e - z3

        ylm = int(math.sqrt(e2))
        xzlm = 3 * z * z + 3 * z + 1

        for y in range(ylm, -1, -1):
            y2 = y * y
            if y2 > e2:
                continue
            e3 = e2 - y2

            xylm = 2 * y + 1
            x = e3
            if x > xylm or x > xzlm:
                continue
            k = min(k, x + y + z)
    return k


def main():
    while True:
        a = int(input())

        if a == 0:
            break

        print(solve(a))


if __name__ == '__main__':
    main()



Fixed submission:
import math


def solve(e):
    k = 2 ** 32
    for z in range(100, -1, -1):
        z3 = z * z * z
        if z3 > e:
            continue
        e2 = e - z3

        ylm = int(math.sqrt(e2))

        for y in range(ylm, -1, -1):
            y2 = y * y
            if e2 > (y + 1) * (y + 1):
                break
            e3 = e2 - y2

            x = e3
            k = min(k, x + y + z)
    return k


def main():
    while True:
        a = int(input())

        if a == 0:
            break

        print(solve(a))


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n = input()
a = []
for i in range(n):
  a.append(input())
a = a.sort()[:3]
b = []
for i in [0,1,2]:
  for j in [0,1,2]:
    if i != j:
      b.append(int(str(a[i] + a[j])))
b.sort()
return(b[2])


Fixed submission:
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
a.sort()
a = a[:4]
b = []
for i in [0,1,2,3]:
  for j in [0,1,2,3]:
    if i != j:
      b.append(int(str(a[i]) + str(a[j])))
b.sort()
print(b[2])

Buggy python submission (verdict: Runtime Error):
n = input()
a = []
for i in range(n):
  a.append(input())
a = a.sort()[:3]
b = []
for i in [0,1,2]:
  for j in [0,1,2]:
    if i != j:
      b.append(int(str(a[i] + a[j])))
b.sort()
print(b[2])


Fixed submission:
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
a.sort()
a = a[:4]
b = []
for i in [0,1,2,3]:
  for j in [0,1,2,3]:
    if i != j:
      b.append(int(str(a[i]) + str(a[j])))
b.sort()
print(b[2])

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
a = a.sort()[:3]
b = []
for i in [0,1,2]:
  for j in [0,1,2]:
    if i != j:
      b.append(int(str(a[i] + a[j])))
b.sort()
print(b[2])



Fixed submission:
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
a.sort()
a = a[:4]
b = []
for i in [0,1,2,3]:
  for j in [0,1,2,3]:
    if i != j:
      b.append(int(str(a[i]) + str(a[j])))
b.sort()
print(b[2])

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
a = a.sort()
a = a[:3]
b = []
for i in [0,1,2]:
  for j in [0,1,2]:
    if i != j:
      b.append(int(str(a[i] + a[j])))
b.sort()
print(b[2])



Fixed submission:
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
a.sort()
a = a[:4]
b = []
for i in [0,1,2,3]:
  for j in [0,1,2,3]:
    if i != j:
      b.append(int(str(a[i]) + str(a[j])))
b.sort()
print(b[2])
Buggy python submission (verdict: Runtime Error):
import math

def ifprime(num):
  if num == 1:
    return False
  for i in range(2,math.floor(num ** 0.5) + 1):
    if num % i:
      continue
    else:
      return False
  return True

while(True):
  try:
    num = input()
  except:
    break
  count = 0
  for i in range(1,num+1):
    if ifprime(i) and ifprime(num-i):
      count += 1
  print(count)
    
       


Fixed submission:
import math

def ifprime(num):
  if num == 1:
    return False
  for i in range(2,math.floor(num ** 0.5) + 1):
    if num % i:
      continue
    else:
      return False
  return True

while(True):
  try:
    num = int(input())
  except:
    break
  count = 0
  for i in range(1,num+1):
    if ifprime(i) and ifprime(num+1-i):
      count += 1
  print(count)
Buggy python submission (verdict: Runtime Error):
while (True):
  st = input()
  st = [i for i in st if i in ["(",")","[","]"]
  han = []
  ans = "Yes"
  for i in st:
    if i == "(":
      han.append("maru")
    elif i == "[":
      han.append("kaku")
    elif i == ")":
      if han == []:
        ans = "No"
        break
      elif han[-1] == "maru":
        del han[-1]
      else:
        ans = "No"
        break
    elif i == "[":
      if han == []:
        ans = "No"
        break
      elif han[-1] == "kaku":
        del han[-1]
      else:
        ans = "No"
        break
  if ans == "No" or han != []:
    print("No")
  else:
    print(ans)


Fixed submission:
while (True):
  st = input()
  if st == ".":
      quit()
  han = []
  ans = "yes"
  for i in st:
    if i == "(":
      han.append("maru")
    elif i == "[":
      han.append("kaku")
    elif i == ")":
      if han == []:
        ans = "no"
        break
      elif han[-1] == "maru":
        del han[-1]
      else:
        ans = "no"
        break
    elif i == "]":
      if han == []:
        ans = "no"
        break
      elif han[-1] == "kaku":
        del han[-1]
      else:
        ans = "no"
        break
  if ans == "no" or han != []:
    print("no")
  else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
while(True):
  e = int(input())
  if e == 0:
    quit()
  ans = e
  for i in range(0,int(e ** (1/3))+1):
      for j in range(0,int((e - i ** 3)**0.5)+1):
          k = e - i ** 3 - j ** 2 + i + j
          if k < ans:
              ans = k
  print(ans)



Fixed submission:
from math import floor
while(True):
  e = int(input())
  if e == 0:
    quit()
  ans = e
  for i in range(0,e):
      if i ** 3 > e:
          break
      j = floor((e - i ** 3)**0.5)
      k = e - i ** 3 - j ** 2 + i + j
      if k < ans:
          ans = k
  print(ans)

Buggy python submission (verdict: Runtime Error):
while(True):
  e = int(input())
  if e == 0:
    quit()
  ans = e
  for i in range(0,int(e ** (1/3))+1):
      for j in range(0,int((e - i ** 3)**0.5)+1):
          k = e - i ** 3 - j ** 2 + i + j
          if k < ans:
              ans = k
  print(ans)


Fixed submission:
from math import floor
while(True):
  e = int(input())
  if e == 0:
    quit()
  ans = e
  for i in range(0,e):
      if i ** 3 > e:
          break
      j = floor((e - i ** 3)**0.5)
      k = e - i ** 3 - j ** 2 + i + j
      if k < ans:
          ans = k
  print(ans)
Buggy python submission (verdict: Runtime Error):
while(True):
    tmp = list(map(int,input().split()))
    N, M = tmp[0],tmp[1]
    if N == 0:
        quit()
    hs = [0]
    ws = [0]
    hlen = []
    wlen = []
    ans = 0
    for i in range(N):
        hs.append(hs[-1] + int(input()))
    for i in range(M):
        ws.append(ws[-1] + int(input()))
    for i in range(N):
        for j in range(i+1,N+1):
            hlen.append(hs[j]-hs[i])
    for i in range(M):
        for j in range(i+1,M+1):
            wlen.append(ws[j]-ws[i])
    for i in hlen:
        ans += wlen.count(i)
    print(ans)



Fixed submission:
#問題番号：2015 「Square Route」
#教室内の着席位置：中央*奥
#URL：http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2015
#この問題の制約を見るに、O(N^2)で十分
#しかし、道と道の間の長さがN(N-1)/2あるため、これを求めるだけでO(N^2)
#従って、hとwでの比較はO(N)でしなければならない
while(True):
    tmp = list(map(int,input().split()))
    n,m = tmp[0],tmp[1]
    ans = 0
    #終了するケースを省く
    if n == 0:
        quit()
    hs, ws = [0], [0]
    #hとwについて累積和を取る(これがhsとws)
    for i in range(n):
        hs.append(hs[-1]+int(input()))
    for i in range(m):
        ws.append(ws[-1]+int(input()))
    #hとwについて、道の間の距離を差分として計算してそれぞれ記録(累積和を取っているのでsumを取る必要がなく高速)
    #工夫として、距離を直接記録して行くのではなく、「距離Lになった時にdif[L]をインクリメント」という方針
    #こうすることで最終的な計算をsum(h_dif[L]*w_dif[L])で出せる
    h_dif, w_dif = [0] * (hs[-1]+1), [0] * (ws[-1]+1)
    for i in range(n):
        for j in range(i+1,n+1):
            h_dif[hs[j]-hs[i]] += 1
    for i in range(m):
        for j in range(i+1,m+1):
            w_dif[ws[j]-ws[i]] += 1
    for i in range(1,min(len(h_dif),len(w_dif))):
        ans += h_dif[i] * w_dif[i]
    print(ans)
Buggy python submission (verdict: Runtime Error):
a = input(),split()
t , u = int(a[0]),int(b[0])
def c(x,y):
  if x % y:
    return c(y,x%y)
  else:
    return y
print(c(t,u))


Fixed submission:
a = list(map(int, input().split()))
t , u = a[0],a[1]

def c(x,y):
  if x % y:
    return(c(y,x%y))
  else:
    return(y)

print(c(t,u))

Buggy python submission (verdict: Runtime Error):
a = input().split()
t , u = int(a[0]),int(b[0])
def c(x,y):
  if x % y:
    return c(y,x%y)
  else:
    return y
print(c(t,u))


Fixed submission:
a = list(map(int, input().split()))
t , u = a[0],a[1]

def c(x,y):
  if x % y:
    return(c(y,x%y))
  else:
    return(y)

print(c(t,u))

Buggy python submission (verdict: Runtime Error):
a = input().split()
t , u = int(a[0]),int(b[0])
def c(x,y):
  if x % y:
    return c(y,x%y)
  else:
    return y
print(c(t,u))


Fixed submission:
a = list(map(int, input().split()))
t , u = a[0],a[1]

def c(x,y):
  if x % y:
    return(c(y,x%y))
  else:
    return(y)

print(c(t,u))

Buggy python submission (verdict: Runtime Error):
a = input().split()
t , u = int(a[0]),int(b[0])

def c(x,y):
  if x % y:
    return(c(y,x%y))
  else:
    return(y)

print(c(t,u))


Fixed submission:
a = list(map(int, input().split()))
t , u = a[0],a[1]

def c(x,y):
  if x % y:
    return(c(y,x%y))
  else:
    return(y)

print(c(t,u))

Buggy python submission (verdict: Runtime Error):
a = list(map(int, input().split()))
t , u = int(a[0]),int(b[0])

def c(x,y):
  if x % y:
    return(c(y,x%y))
  else:
    return(y)

print(c(t,u))


Fixed submission:
a = list(map(int, input().split()))
t , u = a[0],a[1]

def c(x,y):
  if x % y:
    return(c(y,x%y))
  else:
    return(y)

print(c(t,u))

Buggy python submission (verdict: Runtime Error):
a = list(map(int, input().split()))
t , u = a[0],a[1]

def c(x,y):
  if x % y:
    return(c(y,x%y))
  else:
    return(y)

print(c(t,u))


Fixed submission:
a = list(map(int, input().split()))
t , u = a[0],a[1]

def c(x,y):
  if x % y:
    return(c(y,x%y))
  else:
    return(y)

print(c(t,u))

Buggy python submission (verdict: Runtime Error):
a = list(map(int, input().split()))
t , u = a[0],a[1]

def c(x,y):
  if x % y:
    return(c(y,x%y))
  else:
    return(y)

print(c(t,u))


Fixed submission:
a = list(map(int, input().split()))
t , u = a[0],a[1]

def c(x,y):
  if x % y:
    return(c(y,x%y))
  else:
    return(y)

print(c(t,u))

Buggy python submission (verdict: Runtime Error):
a = list(map(int, input().split()))
t , u = a[0],a[1]

def c(x,y):
  if x % y:
    return(c(y,x%y))
  else:
    return(y)

print(u//20)


Fixed submission:
a = list(map(int, input().split()))
t , u = a[0],a[1]

def c(x,y):
  if x % y:
    return(c(y,x%y))
  else:
    return(y)

print(c(t,u))

Buggy python submission (verdict: Runtime Error):
a = list(map(int, input().split()))
t , u = a[0],a[1]

def c(x,y):
  if x % y:
    return(c(y,x%y))
  else:
    return(y)

print(c(t,u))


Fixed submission:
a = list(map(int, input().split()))
t , u = a[0],a[1]

def c(x,y):
  if x % y:
    return(c(y,x%y))
  else:
    return(y)

print(c(t,u))
Buggy python submission (verdict: Runtime Error):
count = 0
n = int(input())
def ifprime(num):
  for i in range(2,num ** 0.5 + 1):
    if num % i:
      continue
    else:
      return False
  return True
for _ in range(n):
  a = int(input())
  if ifprime(a):
    count += 1
print(count)


Fixed submission:
import math
count = 0
n = int(input())

def ifprime(num):
  for i in range(2,math.floor(num ** 0.5) + 1):
    if num % i:
      continue
    else:
      return False
  return True

for _ in range(n):
  a = int(input())
  if ifprime(a):
    count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
lis = list(map(int,input().split()))
st = []
for i in lis:
  if i == "+":
    x = st.pop()
    y = st.pop()
    st.append(x+y)
  elif i == "-":
    x = st.pop()
    y = st.pop()
    st.append(y-x)
  elif i == "*":
    x = st.pop()
    y = st.pop()
    st.append(x*y)
  else:
    st.append(i)
print(st[0])  


Fixed submission:
lis = input().split()
st = []
for i in lis:
  if i == "+":
    x = st.pop()
    y = st.pop()
    st.append(x+y)
  elif i == "-":
    x = st.pop()
    y = st.pop()
    st.append(y-x)
  elif i == "*":
    x = st.pop()
    y = st.pop()
    st.append(x*y)
  else:
    st.append(int(i))
print(st[0])
Buggy python submission (verdict: Runtime Error):
from math import pi
print(pi*int(input())**2)


Fixed submission:
from math import pi
k = float(input())
print(pi*k**2,pi*k*2)

Buggy python submission (verdict: Runtime Error):
from math import pi
print(pi*int(input())**2,pi*int(input())*2)


Fixed submission:
from math import pi
k = float(input())
print(pi*k**2,pi*k*2)

Buggy python submission (verdict: Runtime Error):
from math import pi
k = int(input())
print(pi*k**2,pi*k*2)


Fixed submission:
from math import pi
k = float(input())
print(pi*k**2,pi*k*2)

Buggy python submission (verdict: Runtime Error):
pi = 3.14159265358979323846
k = int(input())
print(pi*k**2,pi*k*2)


Fixed submission:
from math import pi
k = float(input())
print(pi*k**2,pi*k*2)
Buggy python submission (verdict: Runtime Error):
a,s=0,input()
while(True):
  t = input().split()
  if t[0] == "END_OF_TEXT":
    print(a)
    quit()
  for i in t:
    if i.lower() in lis:
      a += 1


Fixed submission:
a,s=0,input().lower()
while(True):
  t = input().split()
  if t[0] == "END_OF_TEXT":
    print(a)
    quit()
  for i in t:
    if i.lower() == s:
      a += 1
Buggy python submission (verdict: Time Limit Exceeded):
numberOfInput=int(input())
numberForStock=[]
index=0
while index<numberOfInput:
    inputNumber=int(input())
    numberForStock.append(inputNumber)
    index+=1

numberForReturn=-10**9
for indexForMax in range(1,numberOfInput):
    for indexForMin in range(0,indexForMax):
        if numberForReturn<numberForStock[indexForMax]-numberForStock[indexForMin]:
            numberForReturn=numberForStock[indexForMax]-numberForStock[indexForMin]
            
        
print(numberForReturn)


Fixed submission:
n = int(input())
index=0
minL=[]
moneyL=[]
while index < n:
    inputN = int(input())
    moneyL.append(inputN)
    if index==0:
        minL.append(inputN)
    else:
        if minL[index-1] < inputN:
            minL.append(minL[index-1])
        else:
            minL.append(inputN)
    index+=1

index2=1
maxProfit = -10**9
while index2 < len(moneyL):
    if moneyL[index2] - minL[index2-1] > maxProfit:
        maxProfit = moneyL[index2] - minL[index2-1]
    else:
        pass
    index2+=1

print(maxProfit)

Buggy python submission (verdict: Time Limit Exceeded):
numberOfInput=int(input())
numberForStock=[]
index=0
while index<numberOfInput:
    inputNumber=int(input())
    numberForStock.append(inputNumber)
    index+=1

numberForReturn=-10**9
for indexForMax in range(1,numberOfInput):
    for indexForMin in range(0,indexForMax):
        if numberForReturn<numberForStock[indexForMax]-numberForStock[indexForMin]:
            numberForReturn=numberForStock[indexForMax]-numberForStock[indexForMin]
            
        
print(numberForReturn)


Fixed submission:
n = int(input())
index=0
minL=[]
moneyL=[]
while index < n:
    inputN = int(input())
    moneyL.append(inputN)
    if index==0:
        minL.append(inputN)
    else:
        if minL[index-1] < inputN:
            minL.append(minL[index-1])
        else:
            minL.append(inputN)
    index+=1

index2=1
maxProfit = -10**9
while index2 < len(moneyL):
    if moneyL[index2] - minL[index2-1] > maxProfit:
        maxProfit = moneyL[index2] - minL[index2-1]
    else:
        pass
    index2+=1

print(maxProfit)
Buggy python submission (verdict: Time Limit Exceeded):
#---------------for input--------------------
numberN=int(input())
arrayS=list(map(int,input().split()))

numberQ=int(input())
arrayT=list(map(int,input().split()))
#---------------for input----------------------

def linearSearch(arrayS,arrayT,numberQ):
    machedNumber=0
    index=0
    while index<numberQ:
        if arrayT[index] in arrayS:
            machedNumber+=1
        index+=1
    print(machedNumber) 

#----------------for main------------------------
linearSearch(arrayS,arrayT,numberQ)
#----------------for main------------------------


Fixed submission:
n = int(input())
s = list(map(int, input().split()))
q = int(input())
t = list(map(int, input().split()))

count = 0
for elT in t:
    minI = 0
    maxI = len(s)-1
    while minI <= maxI:
        middle = (minI+maxI)//2
        if s[middle] == elT:
            count+=1
            break
        elif s[middle] < elT:
            minI = middle+1
        else:
            maxI = middle-1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
#---------------for input--------------------
numberN=int(input())
arrayS=list(map(int,input().split()))

numberQ=int(input())
arrayT=list(map(int,input().split()))
#---------------for input----------------------

def linearSearch(arrayS,arrayT,numberQ):
    machedNumber=0
    listForMached=[]
    index=0
    while index<numberQ:
        for s in arrayS:
            if arrayT[index] == s:
                if not s in listForMached:
                    listForMached.append(arrayT[index])
                    machedNumber+=1
            elif arrayT[index]<s:
                break
        index+=1
    print(machedNumber) 

#----------------for main------------------------
linearSearch(arrayS,arrayT,numberQ)
#----------------for main------------------------



Fixed submission:
n = int(input())
s = list(map(int, input().split()))
q = int(input())
t = list(map(int, input().split()))

count = 0
for elT in t:
    minI = 0
    maxI = len(s)-1
    while minI <= maxI:
        middle = (minI+maxI)//2
        if s[middle] == elT:
            count+=1
            break
        elif s[middle] < elT:
            minI = middle+1
        else:
            maxI = middle-1
print(count)
Buggy python submission (verdict: Runtime Error):
import math
l=input().split()
x1=int(l[0])
y1=int(l[1])
x2=int(l[2])
y2=int(l[3])

A=math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))
print(A)



Fixed submission:
import math
l=input().split()
x1=float(l[0])
y1=float(l[1])
x2=float(l[2])
y2=float(l[3])

A=math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))
print(A)
Buggy python submission (verdict: Runtime Error):
import math
a=int(input())
b=int(input())

c=a*b
d=math.sqrt(a*a+b*b)
print(str(c)+" "+str(d))


Fixed submission:
l = input().split()

a=int(l[0])*int(l[1])
b=2*int(l[0])+2*int(l[1])

print(str(a)+" "+str(b))

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())

c=a*b
d=2*a+2*b

print(str(c)+" "+str(d))



Fixed submission:
l = input().split()

a=int(l[0])*int(l[1])
b=2*int(l[0])+2*int(l[1])

print(str(a)+" "+str(b))
Buggy python submission (verdict: Runtime Error):
import math

p=math.pi
r=int(input())

a=r*r*p
b=2*r*p

c=round(a,5)
d=round(b,5)

print(str(c)+" "+str(d))


Fixed submission:
import math

p=math.pi
r=float(input())

a=r*r*p
b=2*r*p

c=round(a,5)
d=round(b,5)

print(str(c)+" "+str(d))
Buggy python submission (verdict: Runtime Error):
l=input().split()
a=int(l[0])
b=int(l[1])
if b%2==0:
  c=b/2
  while c>0:
    print(l[1]*"#.")
    print(l[1]*".#")
    c=c-2
else:
  d=b-1
  c=d/2
  while C>0:
    print(l[1]*"#.")
    print(l[1]*".#")
    c=c-2
  print(l[1]*"#.")




Fixed submission:
flag=1
listForA = []
while flag:
    h, w = map(int, input().split())
    if h == 0 and w == 0:
        flag=0
    else:
        index=0
        while index < h:
            if index%2==0:
                if w%2==0:
                    pattern = w//2
                    listForA.append("#."*pattern)
                else:
                    pattern = w//2
                    listForA.append("#."*pattern+"#")
            else:
                if w % 2 == 0:
                    pattern = w//2
                    listForA.append(".#"*pattern)
                else:
                    pattern = w//2
                    listForA.append(".#"*pattern+".")
            index+=1
        listForA.append("")

for a in listForA:
    print(a)

Buggy python submission (verdict: Runtime Error):
while True:
    l=input().split()
    a=int(l[0])
    b=int(l[1])
    if a==0 and b==0:
        break
    else:
        if a%2==0:
            c=a/2
            if b%2==0:
                d=b/2
                while c>0:
                    print(d*"#.")
                    print(d*".#")
                    c=c-2
            else:
                e=b-1
                f=e/2
                while c>0:
                    print(f*"#."+"#")
                    print(f*".#"+".")
                    c=c-2
        else:
            g=a-1
            c=g/2
            if b%2==0:
                h=b/2
                while c>0:
                    print(h*"#.")
                    print(h*".#")
                    c=c-2
                print(h*"#.")
            else:
                i=b-1
                j=i/2
                while c>0:
                    print(j*"#."+"#")
                    print(j*".#"+".")
                    c=c-2
                print(j*"#."+"#")
    print("")


Fixed submission:
flag=1
listForA = []
while flag:
    h, w = map(int, input().split())
    if h == 0 and w == 0:
        flag=0
    else:
        index=0
        while index < h:
            if index%2==0:
                if w%2==0:
                    pattern = w//2
                    listForA.append("#."*pattern)
                else:
                    pattern = w//2
                    listForA.append("#."*pattern+"#")
            else:
                if w % 2 == 0:
                    pattern = w//2
                    listForA.append(".#"*pattern)
                else:
                    pattern = w//2
                    listForA.append(".#"*pattern+".")
            index+=1
        listForA.append("")

for a in listForA:
    print(a)
Buggy python submission (verdict: Runtime Error):
n=int(input())

a=input().split()
b=[]
c=[]
i=0
while i<n:
    b.append(int(a[i]))
    i+=1

while n>0:
    c.append(max(b))
    b.remove(max(b))
    n=n-1

answer=str(c[0])
m=2
while m<i+1:
    answer=answer+" "+str(c[m-1])
    m=m+1
print(answer)



Fixed submission:
n=int(input())

a=input().split()
b=[]
c=[]
i=0
while i<n:
    b.append(int(a[i]))
    i+=1

answer=str(b[n-1])
while n>1:
    answer=answer+" "+str(b[n-2])
    n=n-1
print(answer)