Input
4
2 4 5 9
4
2 4 11 12
Output
11
12
5
9
Expected output
5
9
11
12
I was expecting the list to be sorted but it is getting sorted according to the sets , even after it was converted from the set to a list.
Code
m = int(input())
minp=input().split()
n = int(input())
ninp=input().split()
a,b=set(minp),set(ninp)
set3=list(b.difference(a).union(a.difference(b)))
set3.sort()
for i in set3:
print(i)