How to extract the band name where the maximum value resides

Hi, I have an image that is divided into 14 optical classes, and I want to find out from the 14 water optical classes where the maximum membership of Pixel i is in class j, i.e., the dominant optical water class j of pixel i. I can only find the maximum membership that pixel i belongs to in the Math Band, but I don’t know which optical water classification of pixel i belongs to. What am I supposed to do?