(A game of robot) Can any one tell me what wrong i'm doing in this code

n = int(input())
for i in range(0,n):
B = True
a = list(input().split())
for i in range(0,len(a)):
for j in range(0,len(a)):
if((a[i] == a[j]) and (i != j)):
if(a[i] == ‘.’):
break
else:
B = B and False
break
if (B == True):
print(‘safe’)
else:
print(‘unsafe’)

//