<｜begin▁of▁sentence｜>### Instruction:
Given an undirected graph with edge set [(1, 2), (2, 3), (3, 4)], can you use the Matching object's __str__ method in NetworkX to print the matching as a string?
### Response:
import networkx as nx

# Create an undirected graph
G = nx.Graph()
G.add_edges_from([(1, 2), (2, 3), (3, 4)])

# Find a maximum matching in the graph
matching = nx.algorithms.matching.Matching(G)

# Print the matching as a string
print(str(matching))
<|EOT|>
