Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
r = int(input().split)
print("%.5f %.5f" %(r**2*3.14, 2*r*3.14))


Fixed submission:
#
# 4b
#
import math


def main():
    r = float(input())
    S = r * r * math.pi
    L = 2 * r * math.pi
    print(f"{S:.6f} {L:.6f}")


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
r = float(input().split)
print("%.5f %.5f" %(r**2*3.14, 2*r*3.14))


Fixed submission:
#
# 4b
#
import math


def main():
    r = float(input())
    S = r * r * math.pi
    L = 2 * r * math.pi
    print(f"{S:.6f} {L:.6f}")


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
r = float(input().split())
print("%.5f %.5f" %(r**2*3.14, 2*r*3.14))


Fixed submission:
#
# 4b
#
import math


def main():
    r = float(input())
    S = r * r * math.pi
    L = 2 * r * math.pi
    print(f"{S:.6f} {L:.6f}")


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):

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


Fixed submission:
#
# 5a
#

def main():
    while True:
        H, W = map(int, input().split())
        if H == W == 0:
            break
        for i in range(H):
            print("#"*W)
        print()


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):

h,w = map(int, input().split())
if h == 0 and w == 0:
else:
    for i in range(h):
        print("#"*w)
    print()


Fixed submission:
#
# 5a
#

def main():
    while True:
        H, W = map(int, input().split())
        if H == W == 0:
            break
        for i in range(H):
            print("#"*W)
        print()


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):

h,w = map(int, input().split())
    for i in range(h):
        print("#"*w)
    print()


Fixed submission:
#
# 5a
#

def main():
    while True:
        H, W = map(int, input().split())
        if H == W == 0:
            break
        for i in range(H):
            print("#"*W)
        print()


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
while True:
    h,w = map(int, input().split())
    if h == 0 and w == 0:
        break
    else:
        for i in range(h):
            if i == 0 or i == h-1
                print("#" * w)
            else:
                print("#" + "." * (w-2) + "#")
    print()


Fixed submission:
#
# 5b
#

def main():
    while True:
        H, W = map(int, input().split())
        if H == W == 0:
            break
        for i in range(H):
            if i == 0 or i == H - 1:
                print("#" * W)
            else:
                print("#" + "." * (W-2) + "#")
        print()


if __name__ == '__main__':
    main()

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


Fixed submission:
#
# 5b
#

def main():
    while True:
        H, W = map(int, input().split())
        if H == W == 0:
            break
        for i in range(H):
            if i == 0 or i == H - 1:
                print("#" * W)
            else:
                print("#" + "." * (W-2) + "#")
        print()


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(map(int, input().split()))

for i in l[::-1]:
    if i > 1
        print(" ")
    print("%d " %i, end="")
print()


Fixed submission:
#
# 6a
#

def main():
    n = int(input())
    a = list(map(int, input().split()))
    a.reverse()
    print(*a)


if __name__ == '__main__':
    main()

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

for i in range(n):
	if i >= 1:
		print(" ", end = '')
	print(a[i], end = '')
print()


Fixed submission:
#
# 6a
#

def main():
    n = int(input())
    a = list(map(int, input().split()))
    a.reverse()
    print(*a)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
table = [0] * 4*3*10

n = int(input())

for i in range(n)
    b,f,r,v = map(int, input().split())
    table[30(b-1)+10(f-1)+(r-1)] += v

for i in range(120)
    if i % 30:
        print("####################")
    print(table[i], end="")
    if i%10 ==9:
        print()
    else:
        print(" ", end="")



Fixed submission:
#
# 6c
#


def main():
    A = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
    n = int(input())
    for i in range(n):
        b, f, r, v = map(int, input().split())
        A[b-1][f-1][r-1] += v
    for i in range(4):
        for j in range(3):
            print(" ", end="")
            print(*A[i][j])
        if i < 3:
            print("#" * 20)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
table = [0] * 4*3*10

n = int(input())

for i in range(n):
    b,f,r,v = map(int, input().split())
    table[30(b-1)+10(f-1)+(r-1)] += v

for i in range(120)
    if i % 30:
        print("####################")
    print(table[i], end="")
    if i%10 ==9:
        print()
    else:
        print(" ", end="")



Fixed submission:
#
# 6c
#


def main():
    A = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
    n = int(input())
    for i in range(n):
        b, f, r, v = map(int, input().split())
        A[b-1][f-1][r-1] += v
    for i in range(4):
        for j in range(3):
            print(" ", end="")
            print(*A[i][j])
        if i < 3:
            print("#" * 20)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
table = [0] * 4*3*10

n = int(input())

for i in range(n):
    b,f,r,v = map(int, input().split())
    table[30(b-1)+10(f-1)+(r-1)] += v

for i in range(120):
    if i % 30:
        print("####################")
    print(table[i], end="")
    if i%10 ==9:
        print()
    else:
        print(" ", end="")



Fixed submission:
#
# 6c
#


def main():
    A = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
    n = int(input())
    for i in range(n):
        b, f, r, v = map(int, input().split())
        A[b-1][f-1][r-1] += v
    for i in range(4):
        for j in range(3):
            print(" ", end="")
            print(*A[i][j])
        if i < 3:
            print("#" * 20)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())

a = [0] * n
b = [0] * m

for i in range(n):
    a[i] = list(map(int, input().split()))

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

for i in range(m):
    ret = 0
    for j in range(n):
        ret += a[i][j] * b[j]    
    print(ret)
    



Fixed submission:
#
# 6d
#


def main():
    n, m = map(int, input().split())
    A = [[0 for i in range(m)] for j in range(n)]
    B = [0 for i in range(m)]
    C = [0 for i in range(n)]
    for i in range(n):
        A[i] = list(map(int, input().split()))
    for i in range(m):
        B[i] = int(input())

    for i in range(n):
        for j in range(m):
            C[i] += A[i][j] * B[j]
        print(C[i])


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
# naive

x, y = map(int, input().split())

s = min(x,y)
l = max(x,y)
for i in list(range(s+1)[::-1]):
    if s % i == 0:
        if l % i == 0:
            print(i)
            break


Fixed submission:
x, y = map(int, input().split())
l = max(x, y)
s = min(x, y)

for i in range(x):
    olds = s
    oldl = l
    s = oldl % olds
    l = olds

    if s == 0:
        print(l)
        break

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

s = min(x,y)
l = max(x,y)
for i in reversed(range(s+1)):
    if s % i == 0:
        if l % i == 0:
            print(i)
            break


Fixed submission:
x, y = map(int, input().split())
l = max(x, y)
s = min(x, y)

for i in range(x):
    olds = s
    oldl = l
    s = oldl % olds
    l = olds

    if s == 0:
        print(l)
        break
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
v = []

for _ in range(n):
    v.append(int(input()))

n_prime = 0
for v_ in v:
    isprime = True

    if v_ <= 1:
        continue

    for i in range(v_):
        if i <= 1:
            continue
        if v_ % i == 0:
            isprime = False
            break

    n_prime = n_prime + isprime

print(n_prime)



Fixed submission:
import math
n = int(input())
v = []

for _ in range(n):
    v.append(int(input()))

n_prime = 0
for v_ in v:
    isprime = True

    if v_ <= 1:
        continue

    for i in range(1+int(math.sqrt(v_))):
        if i <= 1:
            continue
        if v_ % i == 0:
            isprime = False
            break

    n_prime = n_prime + isprime

print(n_prime)
Buggy python submission (verdict: Runtime Error):
for i in range(10000):
    print("Case {}: {}".format(i+1, int(input()))


Fixed submission:
for i in range(10000):
    x = int(input())
    print("Case {}: {}".format(i+1, x))
    if x == 0:
        break
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(map(int, input()))
def insertionSort(a, n):#配列aを挿入ソートで並び替える(昇順）
    for i in range(1,n-1):
        v = a[i]
        j = i - 1
        while  >= 0 and a[j] > v:
            a[j+1] = a[j]#a[i]の位置に詰めていく処理
            j -= 1
            print(" ".join(a))#１行ごとに出力
        a[j+1] = v

insertionSort(l,n)


Fixed submission:
n = int(input())
l = list(map(int, input().split()))
print(" ".join(map(str,l)))
def insertionSort(a, n):#配列aを挿入ソートで並び替える(昇順）
    for i in range(1,n):
        v = a[i]
        j = i - 1
        while j >= 0 and a[j] > v:
            a[j+1] = a[j]#a[i]の位置に詰めていく処理
            j -= 1
        a[j+1] = v
        print(" ".join(map(str,a)))#１行ごとに出力
insertionSort(l,n)
Buggy python submission (verdict: Runtime Error):
n = int(input())
r = list((map(int, input()) for i in range(n)))
max_abs = 0
for i in range(len(r)):
    for j in range(i, len(r)):
        max_abs = max(max_abs, abs(r[j]-r[i]))
print(max_abs)


Fixed submission:
import sys
n = int(input())
r = [int(input()) for x in range(n)]
max_val = sys.maxsize * -1
min_val = r[0]
for i in range(1,n):
  max_val = max(max_val, r[i] - min_val)
  min_val = min(min_val, r[i])
print(max_val)
Buggy python submission (verdict: Runtime Error):
#計数ソート
n = int(input())
a = list(map(int, input().split()))

def countSort(a):
    N = max(a)
    c = [0]*(N+2)
    b = [0]*len(a)
    for i in a:
        c[i] += 1
    for i in range(1,len(c)):
        c[i] += c[i-1]
        
    for i in a:
        b[c[i]-1] = i
        c[i] -= 1
    print(b)

countSort(*a)


Fixed submission:
#計数ソート
n = int(input())
a = list(map(int, input().split()))

def countSort(a):
    N = max(a)
    c = [0]*(N+2)
    b = [0]*len(a)
    for i in a:
        c[i] += 1
    for i in range(1,len(c)):
        c[i] += c[i-1]
        
    for i in a:
        b[c[i]-1] = i
        c[i] -= 1
    print(*b)

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

d = []
root = pre[1]
pre = iter(pre).__next__

def dfs(l, r):
    if l >= r:
        return
    c = pre()
    m = ino.index(c)
    dfs(l, m)
    dfs(m+1, r)
    d += [c]
    
dfs(0, len(ino))
print(*c)



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

d = []
root = pre[0]
pre = iter(pre).__next__

def dfs(l, r):
    global d
    if l >= r:
        return
    c = pre()
    m = ino.index(c)
    dfs(l, m)
    dfs(m+1, r)
    d += [c]
    
dfs(0, len(ino))
print(*d)

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

d = []
root = pre[1]
pre = iter(pre).__next__

def dfs(l, r):
    if l >= r:
        return
    c = pre()
    m = ino.index(c)
    dfs(l, m)
    dfs(m+1, r)
    d += [c]
    
dfs(0, len(ino))
print(*d)



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

d = []
root = pre[0]
pre = iter(pre).__next__

def dfs(l, r):
    global d
    if l >= r:
        return
    c = pre()
    m = ino.index(c)
    dfs(l, m)
    dfs(m+1, r)
    d += [c]
    
dfs(0, len(ino))
print(*d)

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

d = []
root = pre[1]
pre = iter(pre).__next__

def dfs(l, r):
    global d
    if l >= r:
        return
    c = pre()
    m = ino.index(c)
    dfs(l, m)
    dfs(m+1, r)
    d += [c]
    
dfs(0, len(ino))
print(*d)



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

d = []
root = pre[0]
pre = iter(pre).__next__

def dfs(l, r):
    global d
    if l >= r:
        return
    c = pre()
    m = ino.index(c)
    dfs(l, m)
    dfs(m+1, r)
    d += [c]
    
dfs(0, len(ino))
print(*d)
Buggy python submission (verdict: Runtime Error):
H=int(input())+1
A=[0]+list(map(int,input().split()))
def h(i):
 l=2*i;r=l+1
 if r<H &&l<H :
  if A[i]<A[l]:
   if A[l]<A[r]:A[i],A[r]=A[r],A[i];h(r)
   else:A[i],A[l]=A[l],A[i];h(l)
  elif A[i]<A[r]:A[i],A[r]=A[r],A[i];h(r)
 elif l<H and A[i]<A[l]:A[i],A[l]=A[l],A[i];h(l)
for i in range(H//2,0,-1):h(i)
print(' '+' '.join(map(str,A[1:])))


Fixed submission:
H=int(input())+1
A=[0]+list(map(int,input().split()))
def h(i):
 l=2*i;r=l+1
 if r<H and l<H:
  if A[i]<A[l]:
   if A[l]<A[r]:A[i],A[r]=A[r],A[i];h(r)
   else:A[i],A[l]=A[l],A[i];h(l)
  elif A[i]<A[r]:A[i],A[r]=A[r],A[i];h(r)
 elif l<H and A[i]<A[l]:A[i],A[l]=A[l],A[i];h(l)
for i in range(H//2,0,-1):h(i)
print(' '+' '.join(map(str,A[1:])))

Buggy python submission (verdict: Runtime Error):
H=int(input())+1
A=[0]+list(map(int,input().split()))
def h(i):
 l=2*i;r=l+1
 if r<H && l<H:
  if A[i]<A[l]:
   if A[l]<A[r]:A[i],A[r]=A[r],A[i];h(r)
   else:A[i],A[l]=A[l],A[i];h(l)
  elif A[i]<A[r]:A[i],A[r]=A[r],A[i];h(r)
 elif l<H and A[i]<A[l]:A[i],A[l]=A[l],A[i];h(l)
for i in range(H//2,0,-1):h(i)
print(' '+' '.join(map(str,A[1:])))


Fixed submission:
H=int(input())+1
A=[0]+list(map(int,input().split()))
def h(i):
 l=2*i;r=l+1
 if r<H and l<H:
  if A[i]<A[l]:
   if A[l]<A[r]:A[i],A[r]=A[r],A[i];h(r)
   else:A[i],A[l]=A[l],A[i];h(l)
  elif A[i]<A[r]:A[i],A[r]=A[r],A[i];h(r)
 elif l<H and A[i]<A[l]:A[i],A[l]=A[l],A[i];h(l)
for i in range(H//2,0,-1):h(i)
print(' '+' '.join(map(str,A[1:])))
Buggy python submission (verdict: Time Limit Exceeded):
#線分交差問題

import bisect

class BIT:
    def __init__(self, n):
        self.tree = [0]*(n+1)
        self.n = n
    
    def add(self, i, v):
        while i <= self.n:
            self.tree[i] += v
            i += i & -i
        
    
    def _sum(self, i):
        ret = 0
        while i:
            ret += self.tree[i]
            i -= i & -i
        return ret
    
    def sum(self, l, h):
        return self._sum(h) - self._sum(l-1)
    
n = int(input())
vx = []
xs = set()
for _ in range(n):
    x1, y1, x2, y2 = map(int, input().split())
    if x1 == x2:
        if y1 > y2:
            y1, y2 = y2, y1
        vx.append((y1, float('-inf'),x1))
        vx.append((y2, float('inf'),x2))
        xs.add(x1)
    else:
        if x1 > x2:
            x1, x2 = x2, x1
        vx.append((y1, x1, x2))
vx.sort()

bit = BIT(len(xs))
xs = [float('-inf')] + sorted(xs)
ix = {v: i for i, v in enumerate(xs)}
ans = 0

for y, j, x2 in vx:
    if j == float('-inf'):
        bit.add(ix[x2],1)
    elif j == float('inf'):
        bit.add(xs.index(x2), -1)
    else:
        l = bisect.bisect_left(xs, j)
        r = bisect.bisect(xs, x2) - 1
        ans += bit.sum(l, r)
        
print(ans)



Fixed submission:
#線分交差問題

import bisect

class BIT:
    def __init__(self, n):
        self.tree = [0]*(n+1)
        self.n = n
    
    def add(self, i, v):
        while i <= self.n:
            self.tree[i] += v
            i += i & -i
        
    
    def _sum(self, i):
        ret = 0
        while i:
            ret += self.tree[i]
            i -= i & -i
        return ret
    
    def sum(self, l, h):
        return self._sum(h) - self._sum(l-1)
    
n = int(input())
vx = []
xs = set()
for _ in range(n):
    x1, y1, x2, y2 = map(int, input().split())
    if x1 == x2:
        if y1 > y2:
            y1, y2 = y2, y1
        vx.append((y1, float('-inf'),x1))
        vx.append((y2, float('inf'),x2))
        xs.add(x1)
    else:
        if x1 > x2:
            x1, x2 = x2, x1
        vx.append((y1, x1, x2))
vx.sort()

bit = BIT(len(xs))
xs = [float('-inf')] + sorted(xs)
ix = {v: i for i, v in enumerate(xs)}
ans = 0

for y, j, x2 in vx:
    if j == float('-inf'):
        bit.add(ix[x2],1)
    elif j == float('inf'):
        bit.add(ix[x2], -1)
    else:
        l = bisect.bisect_left(xs, j)
        r = bisect.bisect(xs, x2) - 1
        ans += bit.sum(l, r)
        
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
x1, y1, x2, y2 = map(int, input().split())
print(f'{math.sqrt((x2-x1)**2+(y2-y1)**2):.8f}')


Fixed submission:
import math
x1, y1, x2, y2 = map(float, input().split())
print(f'{math.sqrt((x2-x1)**2+(y2-y1)**2):.8f}')

Buggy python submission (verdict: Runtime Error):
import math
x1, y1, x2, y2 = map(int, input().split())
print(f'{math.sqrt((x2-x1)**2+(y2-y1)**2):.8f}')


Fixed submission:
import math
x1, y1, x2, y2 = map(float, input().split())
print(f'{math.sqrt((x2-x1)**2+(y2-y1)**2):.8f}')
Buggy python submission (verdict: Runtime Error):
from math import sin, cos, pi, sqrt
a, b, c = map(int, input().split())
s = a*b*sin(pi*c/180)/2
c = sqrt(a**2 + b**2 -a*b*2*cos(pi*c/180))
h = 2*S/a
print(s)
print(a+b+c)
print(h)


Fixed submission:
from math import sin, cos, pi, sqrt
a, b, c = map(int, input().split())
s = a*b*sin(pi*c/180)/2
c = sqrt(a**2 + b**2 -a*b*2*cos(pi*c/180))
h = 2*s/a
print(s)
print(a+b+c)
print(h)
Buggy python submission (verdict: Runtime Error):
a, b ,c = map(int, inpput().split())
if a < b < c:
    print('Yes')


Fixed submission:
a, b ,c = map(int, input().split())
if a < b < c:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
for i in range(3000):
    a, b = map(int, input().split())
    if a <= b:
        print(a, b)
    else:
        print(b, a)


Fixed submission:
for i in range(3000):
    a, b = map(int, input().split())
    if a == 0 and b == 0:
        break
    if a <= b:
        print(a, b)
    else:
        print(b, a)

Buggy python submission (verdict: Runtime Error):
for i in range(3001):
    a, b = map(int, input().split())
    if a <= b:
        print(a, b)
    else:
        print(b, a)


Fixed submission:
for i in range(3000):
    a, b = map(int, input().split())
    if a == 0 and b == 0:
        break
    if a <= b:
        print(a, b)
    else:
        print(b, a)
Buggy python submission (verdict: Runtime Error):
import math
r = int(input())
print(f'{r**2*math.pi:.8f}')


Fixed submission:
import math
r = float(input())
print(f'{r**2*math.pi:.8f} {math.pi*r*2:.8f}')
Buggy python submission (verdict: Runtime Error):
a, b = map(int,input().split())
cnt = 1
while a != 0:
    if cnt//2 = 1:
        if b//2 = 0:
            print('#.'*(b//2))
        else:
            print('#.'(b//2)+'#')
    else:
        if b//2 = 0:
            print('.#'*(b//2))
        else:
            print('.#'(b//2)+'.')
    print()
    a, b = map(int,input().split())


Fixed submission:
a, b = map(int,input().split())
while a != 0:
    cnt = 1
    while cnt <= a:
        if cnt%2 == 1:
            if b%2 == 0:
                print('#.'*(b//2))
            else:
                print('#.'*(b//2)+'#')
        else:
            if b%2 == 0:
                print('.#'*(b//2))
            else:
                print('.#'*(b//2)+'.')
        cnt += 1
    print()
    a, b = map(int,input().split())
Buggy python submission (verdict: Runtime Error):
a = set()
i = 1
n = int(input())
def checkNum():
    global a, i, x
    x = i
    if x%3 ==0:
        a.add(i)
        endCheck()
    include3()
    x //= 10;
    if x:
        include3()
    endCheck()

def include3():
    global a, i
    if x%10 == 3:
        a.add(i)
        endCheck()
        
def endCheck():
    global i
    if i+1 <= n:
        i += 1
        checkNum()
    
        
checkNum()

print('',*a)



Fixed submission:
n = int(input())
for i in range(1, n+1):
    if i%3 == 0 or  str(i).find('3') != -1:
        print(f" {i}", end = '')
print()

Buggy python submission (verdict: Runtime Error):
a = set()
i = 1
n = int(input())
def checkNum():
    global a, i, x
    x = i
    if x%3 ==0:
        a.add(i)
        endCheck()
    include3()
    x //= 10;
    if x:
        include3()
    endCheck()

def include3():
    global a, i
    if x%10 == 3:
        a.add(i)
        endCheck()
        
def endCheck():
    global i
    if i+1 <= n:
        i += 1
        checkNum()
    
        
checkNum()

print('',*a)



Fixed submission:
n = int(input())
for i in range(1, n+1):
    if i%3 == 0 or  str(i).find('3') != -1:
        print(f" {i}", end = '')
print()

Buggy python submission (verdict: Runtime Error):
a = set()
i = 1
n = int(input())
def checkNum():
    global a, i, x
    x = i
    if x%3 ==0:
        a.add(i)
        endCheck()
    include3()
    x //= 10;
    if x:
        include3()
    endCheck()

def include3():
    global a, i
    if x%10 == 3:
        a.add(i)
        endCheck()
        
def endCheck():
    global i
    if i+1 <= n:
        i += 1
        checkNum()
    
        
checkNum()

print('',*a)



Fixed submission:
n = int(input())
for i in range(1, n+1):
    if i%3 == 0 or  str(i).find('3') != -1:
        print(f" {i}", end = '')
print()
Buggy python submission (verdict: Runtime Error):
a = {}
for s in ["S", "H", "C", "D"]:
    a.update({f'{s} {i}': 0 for i in range(1, 14)})
n = int(input())
for _ in range(n):
    s = input()
    print(s)
    del a[s]
        
a = list(a)
for i in len(a):
    print(a[i])
    

    
    


Fixed submission:
a = {}
for s in ["S", "H", "C", "D"]:
    a.update({f'{s} {i}': 0 for i in range(1, 14)})
n = int(input())
for _ in range(n):
    s = input()
    del a[s]
        
a = list(a)
for i in range(len(a)):
    print(a[i])
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = []

a = [[[0]*10 for _ in range(3)] for _ in range(4)]

for i in range(n):
    b, f, r, v = map(int, input().split())
    a[b][f][r] += v

for i in range(4):
    for j in range(3):
        print(*a[i][j])
    print('#'*20)

    


Fixed submission:
n = int(input())
a = []

a = [[[0]*10 for _ in range(3)] for _ in range(4)]

for i in range(n):
    b, f, r, v = map(int, input().split())
    a[b-1][f-1][r-1] += v

for i in range(4):
    for j in range(3):
        print('',*a[i][j])
    if i != 3:
        print('#'*20)

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

a = [[[0]*10 for _ in range(3)] for _ in range(4)]

for i in range(n):
    b, f, r, v = map(int, input().split())
    a[b][f][r] += v

for i in range(4):
    for j in range(3):
        print(*a[i][j])
    print('#'*20)

    


Fixed submission:
n = int(input())
a = []

a = [[[0]*10 for _ in range(3)] for _ in range(4)]

for i in range(n):
    b, f, r, v = map(int, input().split())
    a[b-1][f-1][r-1] += v

for i in range(4):
    for j in range(3):
        print('',*a[i][j])
    if i != 3:
        print('#'*20)

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

a = [[[0]*10 for _ in range(3)] for _ in range(4)]

for i in range(n):
    b, f, r, v = map(int, input().split())
    a[b][f][r] += v

for i in range(4):
    for j in range(3):
        print(*a[i][j])
    print('#'*20)

    


Fixed submission:
n = int(input())
a = []

a = [[[0]*10 for _ in range(3)] for _ in range(4)]

for i in range(n):
    b, f, r, v = map(int, input().split())
    a[b-1][f-1][r-1] += v

for i in range(4):
    for j in range(3):
        print('',*a[i][j])
    if i != 3:
        print('#'*20)