a = {1,2,3,4,5}
b = {4,5,6,7,8}
#symmetric difference
print(a^b)
print(b^a)

print()

c = {1,2,3,4,5}
d = {4,5,6,7,8}
#symmetric difference func
print(c.symmetric_difference(d))
print(d.symmetric_difference(c))