Vivek and Party

Test cases are giving wrong answers but the custom input is running correctly. Please can you tell the mistake in the code.

@Anshit
You can check verify your approach with this test case
Q : 5
A
B
C
D
E
5
C A
D A
B D
E B
E C

A : Case #1: Vivek should drink beverages in this order: E B C D A.