Oops, I got my weights wrong. Try 10, 10, 12, 12, 21, 22.
The spec you give for a Huffman encoder means that you have to generate the tree by combining the lightest two subtrees at each step. Therefore your structure must evolve as follows (using parens and weights because my ascii art sucks):
(a:10 b:10 c:12 d:12 e:21 f:22)
((a b):20 c:12 d:12 e:21 f:22)
((a b):20 (c d):24 e:21 f:22)
(((a b) e):41 (c d):24 f:22)
(((a b) e):41 ((c d) f):46)
That grouping is forced from your description of the Huffman spec, and conflicts with arranging the elements in order of ascending weight.