Colorful Boxes

Give each letter from A-P a unique value from 1-20. (Ignore the values that are left.)
(You can hover over boxes to see their color. This is for accessibility and not otherwise part of the puzzle.)
Note: Since a single cell of text copied into Excel or Google Sheets must all be one color, some of the boxes are replaced with their color in the copy-to-clipboard version. This message is not part of the puzzle.


: : red box: [input] green box: [input] [red box, green box, blue box → yellow box, magenta box, cyan box]

Outputs:


Goal:
AAAACCCDDFF
CCCCFFFEGHH



: : red box: [input] green box: [input] [red box, green box, blue box → yellow box, magenta box, cyan box]

Outputs:


Goal:
EEGGGHHIIII
LLHHHJJLLLL



: : red box: [input] green box: [input] [red box, green box, blue box → yellow box, magenta box, cyan box]

Outputs:


Goal:
JJLMMMNNNNN
KOMNNNPPPPP



: : red box: [input] green box: [input] [red box, green box, blue box → yellow box, magenta box, cyan box]

Outputs:


Goal:
ABBDDDMMMNN
DDDOOOPPPPP



2, 3, 5, 7, ...

Extraction:
BLINDACE
FGHJKMOP