Here's the output, A, B, X, Y, and Z.