def concat(seq):
    """
    Concatenate a sequence of sequences.

    Args:
        seq (list | tuple): The sequence to be concatenated.

    Returns:
        list | tuple: The concatenated sequence.
    """
    seq_type = type(seq)

    out = []
    for item in seq:
        out += item

    return seq_type(out)