Buggy python submission (verdict: Time Limit Exceeded):
from collections import*
n,*s=open(0)
n=int(n)
s=deque([tuple(t.rstrip())for t in s])
c=0
for _ in range(n):
  if all(x==y for x,y in zip(s,zip(*s))):c+=n
  s.rotate(1)
print(c)

Fixed submission:
n,*s=[t[:-1]for t in open(0)]
n=int(n)
c=0
for _ in range(n):
  c+=all(x==''.join(y)for x,y in zip(s,zip(*s)))*n
  s=s[1:]+s[:1]
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
n,*s=open(0)
n=int(n)
s=[tuple(t.rstrip())for t in s]
c=0
for _ in range(n):
  if all(x==y for x,y in zip(s,zip(*s))):c+=n
  s=s[1:]+s[:1]
print(c)

Fixed submission:
n,*s=[t[:-1]for t in open(0)]
n=int(n)
c=0
for _ in range(n):
  c+=all(x==''.join(y)for x,y in zip(s,zip(*s)))*n
  s=s[1:]+s[:1]
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
n,*s=open(0)
n=int(n)
s=[tuple(t.rstrip())for t in s]
c=0
for _ in range(n):
  c+=all([x==y for x,y in zip(s,zip(*s))])*n
  s=s[1:]+s[:1]
print(c)

Fixed submission:
n,*s=[t[:-1]for t in open(0)]
n=int(n)
c=0
for _ in range(n):
  c+=all(x==''.join(y)for x,y in zip(s,zip(*s)))*n
  s=s[1:]+s[:1]
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
n,*s=open(0)
n=int(n)
s=[tuple(t.rstrip())for t in s]
c=0
for _ in range(n):
  c+=all(x==y for x,y in zip(s,zip(*s)))*n
  s=s[1:]+s[:1]
print(c)

Fixed submission:
n,*s=[t[:-1]for t in open(0)]
n=int(n)
c=0
for _ in range(n):
  c+=all(x==''.join(y)for x,y in zip(s,zip(*s)))*n
  s=s[1:]+s[:1]
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
n,*s=open(0)
n=int(n)
s=[tuple(t[:-1])for t in s]
c=0
for _ in range(n):
  c+=all(x==y for x,y in zip(s,zip(*s)))*n
  s=s[1:]+s[:1]
print(c)

Fixed submission:
n,*s=[t[:-1]for t in open(0)]
n=int(n)
c=0
for _ in range(n):
  c+=all(x==''.join(y)for x,y in zip(s,zip(*s)))*n
  s=s[1:]+s[:1]
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
n,*s=[t.rstrip()for t in open(0)]
n=int(n)
c=0
for _ in range(n):
  c+=all(x==''.join(y)for x,y in zip(s,zip(*s)))*n
  s=s[1:]+s[:1]
print(c)

Fixed submission:
n,*s=[t[:-1]for t in open(0)]
n=int(n)
c=0
for _ in range(n):
  c+=all(x==''.join(y)for x,y in zip(s,zip(*s)))*n
  s=s[1:]+s[:1]
print(c)

Buggy python submission (verdict: Runtime Error):
(n,),*s=[t.rstrip()for t in open(0)]
n=int(n)
c=0
for _ in range(n):
  c+=all(x==''.join(y)for x,y in zip(s,zip(*s)))*n
  s=s[1:]+s[:1]
print(c)

Fixed submission:
n,*s=[t[:-1]for t in open(0)]
n=int(n)
c=0
for _ in range(n):
  c+=all(x==''.join(y)for x,y in zip(s,zip(*s)))*n
  s=s[1:]+s[:1]
print(c)

Buggy python submission (verdict: Runtime Error):
(n,),*s=[tuple(t[:-1])for t in open(0)]
n=int(n)
c=0
for _ in range(n):
  c+=all(x==y for x,y in zip(s,zip(*s)))*n
  s=s[1:]+s[:1]
print(c)

Fixed submission:
n,*s=[t[:-1]for t in open(0)]
n=int(n)
c=0
for _ in range(n):
  c+=all(x==''.join(y)for x,y in zip(s,zip(*s)))*n
  s=s[1:]+s[:1]
print(c)

Buggy python submission (verdict: Runtime Error):
from collections import*
(n,),*s=[tuple(t[:-1])for t in open(0)]
s=deque(s)
n=int(n)
c=0
for _ in range(n):
  c+=all(x==y for x,y in zip(s,zip(*s)))*n
  s.rotate(1)
print(c)

Fixed submission:
n,*s=[t[:-1]for t in open(0)]
n=int(n)
c=0
for _ in range(n):
  c+=all(x==''.join(y)for x,y in zip(s,zip(*s)))*n
  s=s[1:]+s[:1]
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import*
n,*s=[t[:-1]for t in open(0)]
s=deque(s)
n=int(n)
c=0
for _ in range(n):
  c+=all(x==''.join(y)for x,y in zip(s,zip(*s)))*n
  s.rotate(1)
print(c)

Fixed submission:
n,*s=[t[:-1]for t in open(0)]
n=int(n)
c=0
for _ in range(n):
  c+=all(x==''.join(y)for x,y in zip(s,zip(*s)))*n
  s=s[1:]+s[:1]
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
n,*s=[t[:-1]for t in open(0)]
n=int(n)
c=0
for _ in range(n):
  c+=all(x==''.join(y)for x,y in zip(s,zip(*s)))*n
  s=s[1:]+s[:1]
print(c)

Fixed submission:
n,*s=[t[:-1]for t in open(0)]
n=int(n)
c=0
for _ in range(n):
  c+=all(x==''.join(y)for x,y in zip(s,zip(*s)))*n
  s=s[1:]+s[:1]
print(c)