Problem p03323 (python)

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

if a >= 9 or b >= 9:
    print(":(")
else:
    print("Yay!")

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
li = [list(map(int, input().split()))for i in range(n)]

a = 0
b = 0
c = 0
review = abs(a) + abs(b) + abs(c)
for i in range(m):
    a += li[i][0]
    b += li[i][1]
    c += li[i][2]

review = abs(a) + abs(b) + abs(c)
flag = True

while True:
    flag = True
    for i in range(m):
        for j in range(n-m):
            x = li[i]
            li[i] = li[m+j]
            li[m+j] = x
            a = 0
            b = 0
            c = 0
            for k in range(m):
                a += li[k][0]
                b += li[k][1]
                c += li[k][2]
            if review < abs(a) + abs(b) + abs(c):
                review = abs(a) + abs(b) + abs(c)
                flag = False
    if flag:
        break
    else:
        continue
print(review)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
li = [list(map(int, input().split()))for i in range(n)]

a = 0
b = 0
c = 0
review = abs(a) + abs(b) + abs(c)
for i in range(m):
    a += li[i][0]
    b += li[i][1]
    c += li[i][2]

review = abs(a) + abs(b) + abs(c)
flag = True

while True:
    flag = True
    for i in range(m):
        for j in range(n-m):
            x = li[i]
            li[i] = li[m+j]
            li[m+j] = x
            a = 0
            b = 0
            c = 0
            for k in range(m):
                a += li[k][0]
                b += li[k][1]
                c += li[k][2]
            if review < abs(a) + abs(b) + abs(c):
                review = abs(a) + abs(b) + abs(c)
                flag = False
    if flag:
        break
    else:
        continue
print(review)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
li = [list(map(int, input().split()))for i in range(n)]

a = 0
b = 0
c = 0
review = abs(a) + abs(b) + abs(c)
for i in range(m):
    a += li[i][0]
    b += li[i][1]
    c += li[i][2]

review = abs(a) + abs(b) + abs(c)
flag = True

while True:
    flag = True
    for i in range(m):
        for j in range(n-m):
            x = li[i]
            li[i] = li[m+j]
            li[m+j] = x
            a = 0
            b = 0
            c = 0
            for k in range(m):
                a += li[k][0]
                b += li[k][1]
                c += li[k][2]
            if review < abs(a) + abs(b) + abs(c):
                review = abs(a) + abs(b) + abs(c)
                flag = False
    if flag:
        break
    else:
        continue
print(review)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
li = [list(map(int, input().split()))for i in range(n)]

a = 0
b = 0
c = 0
review = abs(a) + abs(b) + abs(c)
for i in range(m):
    a += li[i][0]
    b += li[i][1]
    c += li[i][2]

review = abs(a) + abs(b) + abs(c)
flag = True

while True:
    flag = True
    for i in range(m):
        for j in range(n-m):
            x = li[i]
            li[i] = li[m+j]
            li[m+j] = x
            a = 0
            b = 0
            c = 0
            for k in range(m):
                a += li[k][0]
                b += li[k][1]
                c += li[k][2]
            if review < abs(a) + abs(b) + abs(c):
                review = abs(a) + abs(b) + abs(c)
                flag = False
    if flag:
        break
    else:
        continue
print(review)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
li = [list(map(int, input().split()))for i in range(n)]

a = 0
b = 0
c = 0
review = abs(a) + abs(b) + abs(c)
for i in range(m):
    a += li[i][0]
    b += li[i][1]
    c += li[i][2]

review = abs(a) + abs(b) + abs(c)
flag = True

while True:
    flag = True
    for i in range(m):
        for j in range(n-m):
            x = li[i]
            li[i] = li[m+j]
            li[m+j] = x
            a = 0
            b = 0
            c = 0
            for k in range(m):
                a += li[k][0]
                b += li[k][1]
                c += li[k][2]
            if review < abs(a) + abs(b) + abs(c):
                review = abs(a) + abs(b) + abs(c)
                flag = False
    if flag:
        break
    else:
        continue
print(review)

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

if a >= 9 or b >= 9:
    print(":(")
else:
    print("Yay!")