1 test case not passed

Here is my code https://ide.codingblocks.com/s/254052 . It has passed half pretest, and I am not able to figure out the error.

@tilakparth123 hey ,For this test case your code did not print A in the order of drinking.
5
A
B
C
D
E
5
C A
D A
B D
E B
E C

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.