def Main():
n=int(input())
while n>0:
n-=1
m=int(input())
nums=list(map(int,input().split()))
t=nums[0]
ans=0
for i in range(1,t+1):
if m%nums[i]==0:
ans+=1
else:
break
if ans==t:
print(m,'-',"Wonderful.")
else:
print(m,'-',"Simple.")
if __name__=='__main__':
Main()
n=int(input())
while n>0:
n-=1
m=int(input())
nums=list(map(int,input().split()))
t=nums[0]
ans=0
for i in range(1,t+1):
if m%nums[i]==0:
ans+=1
else:
break
if ans==t:
print(m,'-',"Wonderful.")
else:
print(m,'-',"Simple.")
if __name__=='__main__':
Main()
Comments
Post a Comment