Answer
$C\lt A=B\lt D$
Work Step by Step
We know that the charges in each case are equidistant from the origin.
The sum of the charges in each case are:
Case A: $+q-q+q-q+q-q+q-q=0$
Case B: $+q+2q-q-q-2q-q+q+q=0$
Case C: $-2q-q+2q+q-4q-5q+3q+3q=-3q$
Case D: $-q-q-q-q+8q-q-q-q=+q$
Thus, the required ranking of the electric potentials is $C\lt A=B\lt D$.