At the start:
A sees 12.
A knows B can see 6 or 8.
If 6, B knows A sees 12 or 14.
If 8, B knows A sees 10 or 12.
A knows B knows A sees 10 or 12 or 14.
B sees 8.
B knows A can see 10 or 12.
B knows if A sees 10, A would know B sees 8 or 10.
B knows if A sees 12, A would know B sees 6 or 8.
B knows that A knows B sees 6 or 8 or 10.
Day 1:
A passes.
B thinks, since A sees 10 or 12 he knows I see 6 or 8 or 10.
If I saw 6, I would think he saw 12 or 14.
A knows I see 6 or 8 or 10, so if he actually saw 14 he would know I see 6 and the answer is 20.
A just passed, which means A does not see 14.
B passes.
Day 2:
A thinks, B sees 6 or 8.
If he saw 6 and thought I saw 12 or 14, then when I passed he would know I did not see 14.
That would mean if he saw 6, I would have had to see 12 and he would have known the answer was 18.
B just passed, which means B does not see 6.
That means B sees 8.
At the start: A sees 12. A knows B can see 6 or 8. If 6, B knows A sees 12 or 14. If 8, B knows A sees 10 or 12. A knows B knows A sees 10 or 12 or 14.
B sees 8. B knows A can see 10 or 12. B knows if A sees 10, A would know B sees 8 or 10. B knows if A sees 12, A would know B sees 6 or 8. B knows that A knows B sees 6 or 8 or 10.
Day 1:
A passes.
B thinks, since A sees 10 or 12 he knows I see 6 or 8 or 10. If I saw 6, I would think he saw 12 or 14. A knows I see 6 or 8 or 10, so if he actually saw 14 he would know I see 6 and the answer is 20. A just passed, which means A does not see 14. B passes.
Day 2:
A thinks, B sees 6 or 8. If he saw 6 and thought I saw 12 or 14, then when I passed he would know I did not see 14. That would mean if he saw 6, I would have had to see 12 and he would have known the answer was 18. B just passed, which means B does not see 6. That means B sees 8.
The answer is 20.