Generating a sequence of values
With MyISAM, you can get an AUTO_INCREMENT that starts over with each new value.

CREATE TABLE foo (
    C INT UNSIGNED NOT NULL,
    N INT UNSIGNED NOT NULL AUTO_INCREMENT,
    PRIMARY KEY(C,N)
  ) ENGINE=MyISAM;
INSERT INTO foo (C)
    SELECT C FROM your_table;


Then...

SELECT 100*C + N FROM foo


gives you the desired numbers.  (If you need U and R, add them to foo, etc.)

If this is a 1-time task, then give that a try.  If you need the numbering to be on-going, then it gets messier.