def get_common_shape(x, y):
    """ Get common shape z from two shapes, x and y.
    If x and y are of different ranks, error out.
    If x and y have the same rank, but x[i] != y[i] for some i, then z[i] = -1, indicating UNKNOWN.
    If x and y are equal, z = x
    """
    z = None
    if len(x) == len(y):
        z = list(x)
        for idx in range(len(x)):
            z[idx] = x[idx] if x[idx] == y[idx] else -1
    return z