def get_first_and_last_line(fname):
    """
    Get the first and last line of the file.
    Since the common_crawl files are alphabetical, we can use this information to determine the alphabetic
    range of entries covered by the file. This information will later be used to limit the zone comparison
    to only those zones that would be within that alphabetic range. This is a speed improvement.

    :param fname: The filename to examine for the first and last lines
    :return: Two strings representing the first and last lines, respectively.
    """
    with open(fname, "rb") as fh:
        first = next(fh)
        offs = -10
        while True:
            fh.seek(offs, 2)
            lines = fh.readlines()
            if len(lines) > 1:
                last = lines[-1]
                break
            offs *= 2
        # Return lines by converting bytes back to strings
        return (first.decode("utf-8"), last.decode("utf-8"))