def get_simult_lines(tests, results, test_line_num=0):
    """Returns a line from the input/output, ensuring that
    we are sync'd up between the two."""
    test = tests.pop(0)
    result = results.pop(0)
    
    test_line_num += 1
    
    if test != result:
        raise Exception("Lost sync between files at input line %d.\n  INPUT: %s\n  OUTPUT: %s" % (test_line_num, test, result))
        
    return test