<｜begin▁of▁sentence｜>### Instruction:
Given two graphs, G and H, where G has nodes 0 (label: 'Alpha') and 1 (label: 'Beta') with an edge labeled 'Friendship' connecting them, and H has nodes 1 (label: 'Gamma') and 2 (label: 'Delta') with an edge labeled 'Colleague' connecting them, how do we compose these graphs to combine their nodes and edges, and then print out the resulting graph's node and edge attributes?
### Response:
import networkx as nx

# Graph G
G = nx.Graph()
G.add_nodes_from([(0, {'label': 'Alpha'}), (1, {'label': 'Beta'})])
G.add_edge(0, 1, label='Friendship')

# Graph H
H = nx.Graph()
H.add_nodes_from([(1, {'label': 'Gamma'}), (2, {'label': 'Delta'})])
H.add_edge(1, 2, label='Colleague')

# Compose G and H
R = nx.compose(G, H)

# Printing Nodes and Attributes
for node, attr in R.nodes(data=True):
    print(f'Node {node}: {attr}')

# Printing Edges and Attributes
for source, target, attr in R.edges(data=True):
    print(f'Edge ({source}, {target}): {attr}')
<|EOT|>
