def builddict(fin):
    """
    Build a dictionary mapping from username to country for all classes.
    
    Takes as input an open csv.reader on the edX supplied file that lists
    classname, country, and username and returns a dictionary that maps from 
    username to country
    """
    retdict = {}
    for course, country, username in fin:
        if username not in retdict:
            retdict[username] = country
    return retdict