def find_insert_marker(filenames):
    """Searches for the insert marker and returns (filename, lineno).
    Defaults to the first file and last line if not found.
    """
    marker = 'FAVA-INSERT-MARKER'
    for filename in filenames:
        with open(filename, 'r') as file:
            for lineno, linetext in enumerate(file):
                if marker in linetext:
                    return filename, lineno
    return filenames[0], len(open(filenames[0]).readlines()) + 1
