Can anyone shed some light on why this is a wrong answer?

```
try:
for tc in range(int(input())):
a= list(map(int,input().split(' ')))
a = sorted(a)
diff = abs(a[0]-a[1])
for i in range(len(a)-1):
if abs(a[i]-a[i+1])<diff:
diff = abs(a[i]-a[i+1])
print(diff)
except:
pass
```