def sort_lists(reference, x):
    """
    Sorts elements of lists `x` by sorting `reference`
    
    Returns sorted zip of lists 
    """
    # sort zip of lists
    # specify key for sorting the ith element of `reference` and `x` as the first element of the tuple of the sorted zip object, e.g. pair[0] = (reference[i], x[i])[0]     
    if isinstance(x[0], list):
        s = sorted(zip(reference, *x), key=lambda pair: pair[0])
    else:
        s = sorted(zip(reference, x), key=lambda pair: pair[0])
    
    return zip(*s)