1
Octave, 145 bytes
@(a){[x y]=find(~impad(1,1,1));c=cumsum([0 0;([y x]-2)(++a,:)]);c=c-min(c)+1;n=nnz(a);[nonzeros(sparse(c(:,1),c(:,2),65:n+65,'unique')')' '']}{5}
Since tio doesn't support impad function I changed it so it can run:
Try It Online!
Some Explanations
@(a){
[x y]=find([1 0...