<｜begin▁of▁sentence｜>### Instruction:
Given a graph G with nodes labeled as 'apple', 'banana', and 'cherry' and edges connecting 'apple' to both 'banana' and 'cherry', how would you convert the node labels to consecutive integers starting from 0 while preserving the graph's structure?
### Response:
import networkx as nx

# Create a graph G
G = nx.Graph()
G.add_nodes_from(['apple', 'banana', 'cherry'])
G.add_edges_from([('apple', 'banana'), ('apple', 'cherry')])

# Convert node labels to integers starting from 0
H = nx.convert_node_labels_to_integers(G, first_label=0)

# Print the nodes and edges with their new integer labels
print('Nodes:', H.nodes())
print('Edges:', H.edges())
<|EOT|>
