<｜begin▁of▁sentence｜>### Instruction:
Given a set of integers from 0 to 9, how can we divide them into equivalence classes where two numbers are considered equivalent if their difference is divisible by 3?
### Response:
import networkx as nx

# Function to check modulo 3 equivalence
def mod3(x, y):
    return (x - y) % 3 == 0

# Set of integers from 0 to 9
X = set(range(10))

# Finding equivalence classes for relation mod3
equiv_classes = nx.utils.equivalence_classes(X, mod3)

# Print out the equivalence classes
for cls in equiv_classes:
    print(frozenset(cls))
<|EOT|>
