from typing import List
from typing import Any
from typing import Tuple
import random


def consistent_shuffle(*lists: List[List[Any]]) -> Tuple[List[Any], ...]:
    """
    Shuffle lists consistently.

    Parameters
    ----------
    *lists
        Variable length number of lists

    Returns
    -------
    shuffled_lists : tuple of lists
        All of the lists are shuffled consistently

    Examples
    --------
    >>> import mpu, random; random.seed(8)
    >>> mpu.consistent_shuffle([1,2,3], ['a', 'b', 'c'], ['A', 'B', 'C'])
    ([3, 2, 1], ['c', 'b', 'a'], ['C', 'B', 'A'])
    """
    LEN = len(lists[0])
    if any(len(l) != LEN for l in lists):
        raise ValueError("All lists need to have the same length")
    perm = list(range(LEN))
    random.shuffle(perm)
    lists = tuple([sublist[index] for index in perm] for sublist in lists)
    return lists