Game Theory Nim-Sum Output

For the following test case:
4
6 6 11 7

In the below question, how can the output be AMAN? Can someone show me the optimal moves…