def id_to_str(id, block):
    """Converts a tuple-based id to string
    Args:
        id (tuple(int)): id which is a tuple of ints.
        block: Length of each element of tuple when converted to string. Will be filled with leading zeros.

    >>> id_to_str((3, 14, 5), block=6)
    '000003000014000005'
    """
    if max(id) >= 10**(block+1):
        raise Exception('Id element {} length greater than block={}'.format(max(id), block))
    return ''.join([str(e).zfill(block) for e in id])