<｜begin▁of▁sentence｜>### Instruction:
Given the Condensed Matter Collaborations 2005 graph which you can read from a GML file named cond-mat-2005.gml, can you use the kcut function in cdlib to perform community detection? And can you print out the communities detected by the algorithm?
### Response:
import networkx as nx
from cdlib import algorithms

# Load the condensed matter collaborations 2005 graph
G = nx.read_gml('cond-mat-2005.gml')

# Apply Kcut algorithm for community detection
communities = algorithms.kcut(G, kmax=4)

# Print the communities detected
for community in communities.communities:
    print(community)
<|EOT|>
