from typing import List
from typing import Any


def group_tag_values(values: List[Any], first_round_index: List[int],
                     sc_len: int) -> List[List[Any]]:
    """
    Group values measured for each tag by the offset of the round the tag
    arrived in.

    Parameters
    ----------
    values : list
        values measured for each tag, i-th value is measured for i-th tag
    first_round_index : list of int
        i-th value is the round index the i-th tag arrived in
    sc_len : int
        length of the scenario

    Returns
    -------
    list of lists
        i-th item contains values collected for tags arrived in the i-th
        round from the start of the scenario.
    """
    grouped_values = [list() for _ in range(sc_len)]
    for value, round_index in zip(values, first_round_index):
        grouped_values[round_index % sc_len].append(value)
    return grouped_values