  In this paper we discuss the following scenario. Suppose that two distant
observers share an entangled state of two $D$-level systems. The two observers,
Alice and Bob, have to send randomly their particles through a multi-input
multi-output device. The task is to determine the nature of this device or
black-box, such that Alice will be able to determine with certainty the output
port of Bob's particle. We prove that this black-box is the multi-input-port
quantum sorter. Further, we investigate if it is possible to determine the
output port in the case when three observers are involved by analyzing the
cases when the Greenberger-Horne-Zeilinger (GHZ) state and the W state are
used.
