cannot get why it is showing wrong answer tried everything to solve this my code is :
import math
N = int(input())
c = N
a = []
for i in range(N):
Z = int(input())
A = int(math.sqrt(Z))
b = []
for m in range(A+1):
for q in range(A+1):
a = []
if m ** 2 + q ** 2 == Z:
a = [m,q]
a.sort()
if a not in b:
b.append(a)
b.pop(0)
for j in range(len(b)):
l = b[j]
a = l[0]
x = l[1]
print("(" + str(a) + “,” + str(x) + “)”, end=" ")
