def drop_mid_name(name):
    """Get only first and last name of a student."""
    names = name.split(" ")
    if len(names) == 3:
        return names[0] + ' ' + names[2]
    else:
        return names[0] + ' ' + names[1]