#!/usr/bin/env python

if __name__ == "__main__":
    tlds = {}

    for filename in ["spam_hosts.data.subsample", "verified_hosts.data.subsample"]:
        with open(filename) as f:
            for line in f:
                tld = line.strip().split(".")[-1]
                if tld in tlds:
                    tlds[tld] += 1
                else:
                    tlds[tld] = 1

    tlds["etc"] = 1000

    for tld in sorted(tlds):
        if tlds[tld] >= 1000:
            print tld

    #for tld in sorted(tlds):
    #    print tld
