A={1, 2, 3, 4, 5}

B = {4, 5, 6, 7, 8}

print("Union:", A | B)

print("Intersection:", A & B)

print("Difference A-B:", A-B)

print("Difference B-A:", B-A)

print("Symmetric Difference:", A ^ B)

print("Subset (A⊆B):", A <= B)

print("Superset (A⊇B):", A >= B)

print("Disjoint (A∩B = 0):", A.isdisjoint(B))

# Define the sets
set_a = {1, 2, 3, 4, 5}
set_b = {3, 4, 5, 6, 7}
U = {1, 2, 3, 4, 5, 6, 7, 8} # Universal set

# Compute complements
complement_a = sorted(U - set_a)
complement_b = sorted(U - set_b)

# Display the results

print(f"Complement of A: {complement_a}")
print(f"Complement of B: {complement_b}")

set_a = {1, 2, 3, 4, 5}
set_b = {3, 4, 5, 6, 7}

# Cartesian Product

cartesian_product = {(a, b) for a in set_a for b in set_b}

# Display sorted Cartesian Product

sorted_cartesian_product = sorted(cartesian_product)
print(f"Cartesian Product (sorted):{sorted_cartesian_product}")