<｜begin▁of▁sentence｜>### Instruction:
As a media buyer, you're tasked with optimizing advertising strategies for your clients' marketing campaigns. Imagine you've received a detailed map of potential advertising opportunities represented as a network, conveniently stored in a GML file named 'network.gml'. To enhance your campaign planning, you need to uncover distinct communities within this network that can help tailor your ad placements effectively.

Your goal is to employ the community detection capabilities of the igraph library's `community_multilevel` function, which utilizes the multilevel algorithm pioneered by Blondel et al. After loading the network from the GML file, your first step is to apply this function to identify the community structure. Once done, print out the membership of each vertex to understand which community it belongs to, thus gaining insights into potential target audiences and advertising clusters.

Furthermore, you want to explore the community structures at various levels to grasp the hierarchical organization within the network. To achieve this, set the `return_levels` parameter to True when calling the `community_multilevel` function, allowing you to access community structures at different levels of granularity. This comprehensive approach will empower you to fine-tune your advertising strategies and maximize the impact of your clients' campaigns.
### Response:
import igraph as ig

# Read the graph from a file
g = ig.Graph.Read_GML('network.gml')

# Perform the community detection using the multilevel algorithm
communities = g.community_multilevel()

# Print the membership of each vertex in the final level
print(communities.membership)

# If you want to return all levels of communities set return_levels to True
all_levels = g.community_multilevel(return_levels=True)

# Print the membership of each vertex on all levels
for level in all_levels:
    print(level.membership)
<|EOT|>
