<｜begin▁of▁sentence｜>### Instruction:
Given two graphs with the following edge sets: the first graph has edges [(1, 2), (2, 3)] and the second graph has edges [(4, 5), (5, 6)], how would you use NetworkX to create a new graph that is the disjoint union of these two graphs, ensuring that the new graph has a separate set of nodes for each of the original graphs?
### Response:
import networkx as nx

# Create two separate graphs
G1 = nx.Graph([(1, 2), (2, 3)])
G2 = nx.Graph([(4, 5), (5, 6)])

# Use disjoint_union_all to combine the graphs
U = nx.disjoint_union_all([G1, G2])

# Print the nodes and edges of the resulting graph
print(list(U.nodes()))
print(list(U.edges()))
<|EOT|>
