Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n = int(input())
A = [[ord(i) for i in input()] for j in range(n)]
count = 0
for a in range(n):
    arr = np.array(A[a:][:] + A[:a][:])
    arrT = arr.T
    for i in range(n):
        if list(arr[i][i+1:]) != list(arrT[i][i+1:]):
            break
    else:
        count += n
print(count)

Fixed submission:
n = int(input())
A = [input() for _ in range(n)]
# AT = list(map(''.join,zip(*A)))
count = 0
for a in range(n):
    arr = A[a:][:] + A[:a][:]
    arrT = list(map(''.join, zip(*arr)))
    for i in range(n):
        if arr[i][i+1:] != arrT[i][i+1:]:
            break
    else:
        count += n
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n = int(input())
A = [[ord(i) for i in input()] for j in range(n)]
count = 0
for a in range(n):
    arr = np.array(A[a:][:] + A[:a][:])
    if np.allclose(arr,arr.T):
        count += n
print(count)

Fixed submission:
n = int(input())
A = [input() for _ in range(n)]
# AT = list(map(''.join,zip(*A)))
count = 0
for a in range(n):
    arr = A[a:][:] + A[:a][:]
    arrT = list(map(''.join, zip(*arr)))
    for i in range(n):
        if arr[i][i+1:] != arrT[i][i+1:]:
            break
    else:
        count += n
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n = int(input())
A = [[ord(i) for i in input()] for j in range(n)]
count = 0
for a in range(n):
    arr = np.roll(A, a, axis=0)
    arrT = arr.T
    for i in range(n):
        if list(arr[i][i+1:]) != list(arrT[i][i+1:]):
            break
    else:
        count += n
print(count)

Fixed submission:
n = int(input())
A = [input() for _ in range(n)]
# AT = list(map(''.join,zip(*A)))
count = 0
for a in range(n):
    arr = A[a:][:] + A[:a][:]
    arrT = list(map(''.join, zip(*arr)))
    for i in range(n):
        if arr[i][i+1:] != arrT[i][i+1:]:
            break
    else:
        count += n
print(count)

Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
A = [[ord(i) for i in input()] for j in range(n)]
count = 0
for a in range(n):
    arr = np.roll(A, a, axis=0)
    arrT = arr.T
    for i in range(n):
        if arr[i][i:] != arrT[i][i:]:
            break
    else:
        count += n
print(count)

Fixed submission:
n = int(input())
A = [input() for _ in range(n)]
# AT = list(map(''.join,zip(*A)))
count = 0
for a in range(n):
    arr = A[a:][:] + A[:a][:]
    arrT = list(map(''.join, zip(*arr)))
    for i in range(n):
        if arr[i][i+1:] != arrT[i][i+1:]:
            break
    else:
        count += n
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n = int(input())
A = [[ord(i) for i in input()] for j in range(n)]
count = 0
for a in range(n):
    arr = np.roll(A, a, axis=0)
    if np.allclose(arr,arr.T):
        count += n
print(count)

Fixed submission:
n = int(input())
A = [input() for _ in range(n)]
# AT = list(map(''.join,zip(*A)))
count = 0
for a in range(n):
    arr = A[a:][:] + A[:a][:]
    arrT = list(map(''.join, zip(*arr)))
    for i in range(n):
        if arr[i][i+1:] != arrT[i][i+1:]:
            break
    else:
        count += n
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n = int(input())
A = [[ord(i) for i in input()] for j in range(n)]
count = 0
for a in range(n):
    for b in range(n):
        arr = np.roll(A, a, axis=0)
        arr = np.roll(arr, b, axis=1)
        if np.allclose(arr,arr.T):
            count += 1
print(count)

Fixed submission:
n = int(input())
A = [input() for _ in range(n)]
# AT = list(map(''.join,zip(*A)))
count = 0
for a in range(n):
    arr = A[a:][:] + A[:a][:]
    arrT = list(map(''.join, zip(*arr)))
    for i in range(n):
        if arr[i][i+1:] != arrT[i][i+1:]:
            break
    else:
        count += n
print(count)