def print_wordfreq(freqs, n=10):
    """Print the n most common words and counts in the freqs dict."""
    words, counts = freqs.keys(), freqs.values()
    items = zip(counts, words)
    items = sorted(items, reverse=True)
    for count, word in items[:n]:
        print(word, count)
