from typing import Iterable
from typing import ByteString
from typing import Counter


def count_byte_values(bss: Iterable[ByteString]) -> list[Counter[int]]:
    """Returns a list of Counters, each of which records the values of the
    bytes at the corresponding index in the given ByteStrings."""
    counts_for_idx: list[Counter[int]] = []
    bs_len = None
    for bs in bss:
        if bs_len is None:
            bs_len = len(bs)
            counts_for_idx = [Counter() for _ in range(bs_len)]

        assert len(bs) == bs_len

        for i, b in enumerate(bs):
            counts_for_idx[i][b] += 1

    return counts_for_idx