from typing import List


def failing_task(fail_times: int, failures: List[int]):
    """Fails fail_times, then returns 123.

        :param fail_times: Times to fail in a row before
                           success.

        :param failures: Empty list to append failure indices.

    """
    if fail_times <= len(failures):
        return 123

    if failures:
        failures.append(failures[-1] + 1)
    else:
        failures.append(0)
    raise RuntimeError()