cyclic equality problem