Arrange the following Python code segments in order with respect to exception handling:
(A) except ZeroDivisionError:
\hspace{0.5cm} print("Zero denominator not allowed")
(B) finally:
\hspace{0.5cm} print("Over and Out")
(C) try:
\hspace{0.5cm} n = 50
\hspace{0.5cm} d = int(input("enter denominator"))
\hspace{0.5cm} q = n/d
\hspace{0.5cm} print("division performed")
(D) else:
\hspace{0.5cm} print("Result=", q)