def shuffle(x, order=None):
    """Reorganizes the given string according the order - list of character indices.
    """
    if order == None:
        return x

    res = ""
    for o in order:
        res += x[o]
    return res