The quantum circuit is a variant of the Grover's algorithm, we must find the input accepted by the oracle of the algorithm.
Input qubits are checked 3 at a time 1408 times, out of the 3 equalities at least one must be true to satisfy the oracle.This result in an equation system of 1408 equations. Solving it gives us the state of every qubit satisfying the oracle.Decoding this state as ASCII gives us the flag.