def get_valid_and_invalid_lists(in_list, checker):
    """
    Take a list of strings and return two lists valid_pwds, invalid_pwds
    based on checker.

    signature of checker(password, left, right, in_char)
    """

    valid_pwds = []
    invalid_pwds = []

    for line in in_list:

        rule, password = line.split(":")
        config, in_char = rule.split(" ")
        left, right = config.split("-")

        left = int(left)
        right = int(right)
        password = password.strip()
        in_char = in_char.strip()

        is_valid = checker(password, left, right, in_char)

        if is_valid:
            valid_pwds.append(password)
        else:
            invalid_pwds.append(password)

    return valid_pwds, invalid_pwds