How to Use Maximum a Posteriori Probability (MAP) in Classification Task
I will try to give you some intuition into it by a different example.

Think we have 3 machines which can generate the numbers 1, 2, 3.
The first machine generates the number 1 with 80% and the numbers 2, 3 with 10% each.
The second machine generates the number 2 with 80% and the numbers 1, 3 with 10% each.
The third machine generates the number 3 with 80% and the numbers 1, 2 with 10% each.

One of the machines is chosen, you don't know which and the generated number is 2.
What machine would you bet it would?  

The question above is the likelihood with no prior knowledge.
Hence, given the number 2 the most likely is the second machine.

Yet,
What happens if you are told that the chosen machine would be chosen following this rules - 98% the first machine, 1% the second and 1% the third.

Now, what are the chances?

Seeing 2 from machine 1 are 0.1 * 0.98 = 0.098.
Seeing 2 from machine 2 are 0.8 * 0.01 = 0.008.
Seeing 2 from machine 3 are 0.1 * 0.01 = 0.001.

Now a better choice would be machine 1.
This is the MAP, because we took into account both the likelihood and the prior knowledge.