I think I may throw in the towel on this one. I realized from the start that some of the equations might be negative numbers, so took that into account, but I've still ended up with an impasse since I cannot get valid second and third equations for 15a, which means at least one of my values for C, Y, M, P, A must be wrong. I'm certain of A and Y. It's C that is causing the problem either here or elsewhere. It's possible I've gone wrong with D and P since there are several possibilities there.
Solvers might find this site useful to find the summed squares for a given number:
http://nonagon.org/ExLibris/fermat-sum-two-squares-calculator